Built motion from commit 47436d59.|2.6.7
[motion2.git] / server / api / cmHopperAdditionalPhone / cmHopperAdditionalPhone.controller.js
index c34ff9c..0d0a6bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83f4=['../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','end','sendStatus','error','stack','name','send','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','keys','include','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83f4,0x134));var _0x483f=function(_0x37c003,_0x190644){_0x37c003=_0x37c003-0x0;var _0x1449f6=_0x83f4[_0x37c003];return _0x1449f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x483f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x483f('0x1'));var rp=require(_0x483f('0x2'));var moment=require(_0x483f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x483f('0x4'));var path=require(_0x483f('0x5'));var sox=require('sox');var csv=require(_0x483f('0x6'));var ejs=require(_0x483f('0x7'));var fs=require('fs');var fs_extra=require(_0x483f('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x483f('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x483f('0xa'));var toCsv=require(_0x483f('0x6'));var querystring=require('querystring');var Papa=require(_0x483f('0xb'));var Redis=require(_0x483f('0xc'));var authService=require(_0x483f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x483f('0xe'));var hardwareService=require(_0x483f('0xf'));var logger=require(_0x483f('0x10'))(_0x483f('0x11'));var utils=require('../../config/utils');var config=require(_0x483f('0x12'));var licenseUtil=require(_0x483f('0x13'));var db=require(_0x483f('0x14'))['db'];function respondWithStatusCode(_0x32878f,_0x5d24b4){_0x5d24b4=_0x5d24b4||0xcc;return function(_0x3a6477){if(_0x3a6477){return _0x32878f['sendStatus'](_0x5d24b4);}return _0x32878f[_0x483f('0x15')](_0x5d24b4)['end']();};}function respondWithResult(_0x2c6b31,_0x2e2c20){_0x2e2c20=_0x2e2c20||0xc8;return function(_0x2b0d1f){if(_0x2b0d1f){return _0x2c6b31['status'](_0x2e2c20)['json'](_0x2b0d1f);}};}function respondWithFilteredResult(_0x269fe9,_0xd3a755){return function(_0x17c545){if(_0x17c545){var _0x292de1=typeof _0xd3a755[_0x483f('0x16')]==='undefined'&&typeof _0xd3a755[_0x483f('0x17')]===_0x483f('0x18');var _0x47995e=_0x17c545[_0x483f('0x19')];var _0x5494f5=_0x292de1?0x0:_0xd3a755[_0x483f('0x16')];var _0x3887d5=_0x292de1?_0x17c545['count']:_0xd3a755['offset']+_0xd3a755[_0x483f('0x17')];var _0x3daa2b;if(_0x3887d5>=_0x47995e){_0x3887d5=_0x47995e;_0x3daa2b=0xc8;}else{_0x3daa2b=0xce;}_0x269fe9[_0x483f('0x15')](_0x3daa2b);return _0x269fe9[_0x483f('0x1a')](_0x483f('0x1b'),_0x5494f5+'-'+_0x3887d5+'/'+_0x47995e)[_0x483f('0x1c')](_0x17c545);}return null;};}function patchUpdates(_0x273a45){return function(_0x13772f){try{jsonpatch[_0x483f('0x1d')](_0x13772f,_0x273a45,!![]);}catch(_0x1fc85c){return BPromise[_0x483f('0x1e')](_0x1fc85c);}return _0x13772f['save']();};}function saveUpdates(_0x59747f,_0x201874){return function(_0x1790dd){if(_0x1790dd){return _0x1790dd[_0x483f('0x1f')](_0x59747f)[_0x483f('0x20')](function(_0x15ce3b){return _0x15ce3b;});}return null;};}function removeEntity(_0x312880,_0x48f71d){return function(_0x2502fe){if(_0x2502fe){return _0x2502fe[_0x483f('0x21')]()[_0x483f('0x20')](function(){var _0x1f09de=_0x2502fe['get']({'plain':!![]});var _0x9622c1=_0x483f('0x22');return db[_0x483f('0x23')][_0x483f('0x21')]({'where':{'type':_0x9622c1,'resourceId':_0x1f09de['id']}})[_0x483f('0x20')](function(){return _0x2502fe;});})[_0x483f('0x20')](function(){_0x312880['status'](0xcc)[_0x483f('0x24')]();});}};}function handleEntityNotFound(_0x3933ae,_0x60339a){return function(_0x4f3b28){if(!_0x4f3b28){_0x3933ae[_0x483f('0x25')](0x194);}return _0x4f3b28;};}function handleError(_0x2bf59f,_0x5a3121){_0x5a3121=_0x5a3121||0x1f4;return function(_0x60327d){logger[_0x483f('0x26')](_0x60327d[_0x483f('0x27')]);if(_0x60327d[_0x483f('0x28')]){delete _0x60327d[_0x483f('0x28')];}_0x2bf59f[_0x483f('0x15')](_0x5a3121)[_0x483f('0x29')](_0x60327d);};}exports['index']=function(_0x421eb7,_0x1269f1){var _0x3a06e2={},_0x5436a6={},_0x1fddc6={'count':0x0,'rows':[]};var _0x2999a7=_[_0x483f('0x2a')](db[_0x483f('0x2b')][_0x483f('0x2c')],function(_0x18ddec){return{'name':_0x18ddec[_0x483f('0x2d')],'type':_0x18ddec[_0x483f('0x2e')][_0x483f('0x2f')]};});_0x5436a6[_0x483f('0x30')]=_[_0x483f('0x2a')](_0x2999a7,_0x483f('0x28'));_0x5436a6[_0x483f('0x31')]=_['keys'](_0x421eb7[_0x483f('0x31')]);_0x5436a6[_0x483f('0x32')]=_[_0x483f('0x33')](_0x5436a6[_0x483f('0x30')],_0x5436a6['query']);_0x3a06e2['attributes']=_[_0x483f('0x33')](_0x5436a6[_0x483f('0x30')],qs['fields'](_0x421eb7[_0x483f('0x31')][_0x483f('0x34')]));_0x3a06e2['attributes']=_0x3a06e2[_0x483f('0x35')][_0x483f('0x36')]?_0x3a06e2[_0x483f('0x35')]:_0x5436a6[_0x483f('0x30')];if(!_0x421eb7['query'][_0x483f('0x37')]('nolimit')){_0x3a06e2[_0x483f('0x17')]=qs[_0x483f('0x17')](_0x421eb7[_0x483f('0x31')][_0x483f('0x17')]);_0x3a06e2[_0x483f('0x16')]=qs[_0x483f('0x16')](_0x421eb7[_0x483f('0x31')][_0x483f('0x16')]);}_0x3a06e2[_0x483f('0x38')]=qs['sort'](_0x421eb7[_0x483f('0x31')]['sort']);_0x3a06e2['where']=qs[_0x483f('0x32')](_[_0x483f('0x39')](_0x421eb7[_0x483f('0x31')],_0x5436a6[_0x483f('0x32')]),_0x2999a7);if(_0x421eb7[_0x483f('0x31')][_0x483f('0x3a')]){_0x3a06e2['where']=_[_0x483f('0x3b')](_0x3a06e2[_0x483f('0x3c')],{'$or':_[_0x483f('0x2a')](_0x2999a7,function(_0x894b0a){if(_0x894b0a[_0x483f('0x2e')]!==_0x483f('0x3d')){var _0x3f4e7e={};_0x3f4e7e[_0x894b0a['name']]={'$like':'%'+_0x421eb7[_0x483f('0x31')][_0x483f('0x3a')]+'%'};return _0x3f4e7e;}})});}_0x3a06e2=_[_0x483f('0x3b')]({},_0x3a06e2,_0x421eb7[_0x483f('0x3e')]);var _0x3541f5={'where':_0x3a06e2['where']};return db[_0x483f('0x2b')]['count'](_0x3541f5)[_0x483f('0x20')](function(_0x311670){_0x1fddc6[_0x483f('0x19')]=_0x311670;if(_0x421eb7['query'][_0x483f('0x3f')]){_0x3a06e2['include']=[{'all':!![]}];}return db[_0x483f('0x2b')][_0x483f('0x40')](_0x3a06e2);})[_0x483f('0x20')](function(_0x36aaa5){_0x1fddc6[_0x483f('0x41')]=_0x36aaa5;return _0x1fddc6;})[_0x483f('0x20')](respondWithFilteredResult(_0x1269f1,_0x3a06e2))['catch'](handleError(_0x1269f1,null));};exports[_0x483f('0x42')]=function(_0x36ae0b,_0x2cedbe){var _0x4ad2b2={'raw':!![],'where':{'id':_0x36ae0b['params']['id']}},_0x219c2b={};_0x219c2b[_0x483f('0x30')]=_[_0x483f('0x43')](db[_0x483f('0x2b')][_0x483f('0x2c')]);_0x219c2b[_0x483f('0x31')]=_['keys'](_0x36ae0b[_0x483f('0x31')]);_0x219c2b[_0x483f('0x32')]=_[_0x483f('0x33')](_0x219c2b[_0x483f('0x30')],_0x219c2b[_0x483f('0x31')]);_0x4ad2b2[_0x483f('0x35')]=_['intersection'](_0x219c2b[_0x483f('0x30')],qs[_0x483f('0x34')](_0x36ae0b[_0x483f('0x31')][_0x483f('0x34')]));_0x4ad2b2['attributes']=_0x4ad2b2[_0x483f('0x35')][_0x483f('0x36')]?_0x4ad2b2[_0x483f('0x35')]:_0x219c2b['model'];if(_0x36ae0b['query'][_0x483f('0x3f')]){_0x4ad2b2[_0x483f('0x44')]=[{'all':!![]}];}_0x4ad2b2=_['merge']({},_0x4ad2b2,_0x36ae0b['options']);return db['CmHopperAdditionalPhone']['find'](_0x4ad2b2)[_0x483f('0x20')](handleEntityNotFound(_0x2cedbe,null))[_0x483f('0x20')](respondWithResult(_0x2cedbe,null))[_0x483f('0x45')](handleError(_0x2cedbe,null));};exports[_0x483f('0x46')]=function(_0x5e7b78,_0x32d77a){return db[_0x483f('0x2b')][_0x483f('0x46')](_0x5e7b78[_0x483f('0x47')],{})[_0x483f('0x20')](function(_0x27fd5e){var _0x4b58ce=_0x5e7b78[_0x483f('0x48')][_0x483f('0x49')]({'plain':!![]});if(!_0x4b58ce)throw new Error(_0x483f('0x4a'));if(_0x4b58ce[_0x483f('0x4b')]===_0x483f('0x48')){var _0x2fc217=_0x27fd5e[_0x483f('0x49')]({'plain':!![]});var _0x5b1ecd=_0x483f('0x22');return db[_0x483f('0x4c')][_0x483f('0x4d')]({'where':{'name':_0x5b1ecd,'userProfileId':_0x4b58ce[_0x483f('0x4e')]},'raw':!![]})[_0x483f('0x20')](function(_0x2a8739){if(_0x2a8739&&_0x2a8739[_0x483f('0x4f')]===0x0){return db[_0x483f('0x23')][_0x483f('0x46')]({'name':_0x2fc217[_0x483f('0x28')],'resourceId':_0x2fc217['id'],'type':_0x2a8739[_0x483f('0x28')],'sectionId':_0x2a8739['id']},{})[_0x483f('0x20')](function(){return _0x27fd5e;});}else{return _0x27fd5e;}})[_0x483f('0x45')](function(_0x3f967f){logger[_0x483f('0x26')](_0x483f('0x50'),_0x3f967f);throw _0x3f967f;});}return _0x27fd5e;})[_0x483f('0x20')](respondWithResult(_0x32d77a,0xc9))[_0x483f('0x45')](handleError(_0x32d77a,null));};exports[_0x483f('0x1f')]=function(_0x4e8f5b,_0x561cc1){if(_0x4e8f5b[_0x483f('0x47')]['id']){delete _0x4e8f5b[_0x483f('0x47')]['id'];}return db[_0x483f('0x2b')][_0x483f('0x4d')]({'where':{'id':_0x4e8f5b[_0x483f('0x51')]['id']}})['then'](handleEntityNotFound(_0x561cc1,null))[_0x483f('0x20')](saveUpdates(_0x4e8f5b['body'],null))['then'](respondWithResult(_0x561cc1,null))[_0x483f('0x45')](handleError(_0x561cc1,null));};exports[_0x483f('0x21')]=function(_0x152fd3,_0x3274f7){return db[_0x483f('0x2b')][_0x483f('0x4d')]({'where':{'id':_0x152fd3[_0x483f('0x51')]['id']}})['then'](handleEntityNotFound(_0x3274f7,null))[_0x483f('0x20')](removeEntity(_0x3274f7,null))['catch'](handleError(_0x3274f7,null));};
\ No newline at end of file
+var _0x64c1=['model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','keys','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../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','apply','reject','update','then','destroy','CmHopperAdditionalPhones','error','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','key'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x64c1,0x1b9));var _0x164c=function(_0x1fa11b,_0x10b90c){_0x1fa11b=_0x1fa11b-0x0;var _0x1be73a=_0x64c1[_0x1fa11b];return _0x1be73a;};'use strict';var emlformat=require(_0x164c('0x0'));var rimraf=require(_0x164c('0x1'));var zipdir=require(_0x164c('0x2'));var jsonpatch=require(_0x164c('0x3'));var rp=require('request-promise');var moment=require(_0x164c('0x4'));var BPromise=require(_0x164c('0x5'));var Mustache=require(_0x164c('0x6'));var util=require('util');var path=require(_0x164c('0x7'));var sox=require('sox');var csv=require(_0x164c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x164c('0x9'));var _=require('lodash');var squel=require(_0x164c('0xa'));var crypto=require('crypto');var jsforce=require(_0x164c('0xb'));var deskjs=require(_0x164c('0xc'));var toCsv=require(_0x164c('0x8'));var querystring=require(_0x164c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x164c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x164c('0xf'));var hardwareService=require(_0x164c('0x10'));var logger=require('../../config/logger')(_0x164c('0x11'));var utils=require(_0x164c('0x12'));var config=require(_0x164c('0x13'));var licenseUtil=require(_0x164c('0x14'));var db=require(_0x164c('0x15'))['db'];function respondWithStatusCode(_0x2a3155,_0x31948c){_0x31948c=_0x31948c||0xcc;return function(_0x45c3c5){if(_0x45c3c5){return _0x2a3155[_0x164c('0x16')](_0x31948c);}return _0x2a3155[_0x164c('0x17')](_0x31948c)['end']();};}function respondWithResult(_0x130643,_0x1858d7){_0x1858d7=_0x1858d7||0xc8;return function(_0x4c3140){if(_0x4c3140){return _0x130643[_0x164c('0x17')](_0x1858d7)[_0x164c('0x18')](_0x4c3140);}};}function respondWithFilteredResult(_0x4ceb5d,_0x5ee712){return function(_0x2301db){if(_0x2301db){var _0x323a62=typeof _0x5ee712[_0x164c('0x19')]===_0x164c('0x1a')&&typeof _0x5ee712[_0x164c('0x1b')]===_0x164c('0x1a');var _0x586f88=_0x2301db[_0x164c('0x1c')];var _0x31230e=_0x323a62?0x0:_0x5ee712['offset'];var _0x5658ef=_0x323a62?_0x2301db[_0x164c('0x1c')]:_0x5ee712[_0x164c('0x19')]+_0x5ee712[_0x164c('0x1b')];var _0x1ed37c;if(_0x5658ef>=_0x586f88){_0x5658ef=_0x586f88;_0x1ed37c=0xc8;}else{_0x1ed37c=0xce;}_0x4ceb5d[_0x164c('0x17')](_0x1ed37c);return _0x4ceb5d[_0x164c('0x1d')](_0x164c('0x1e'),_0x31230e+'-'+_0x5658ef+'/'+_0x586f88)['json'](_0x2301db);}return null;};}function patchUpdates(_0x3fd516){return function(_0x2dc406){try{jsonpatch[_0x164c('0x1f')](_0x2dc406,_0x3fd516,!![]);}catch(_0x3f84d7){return BPromise[_0x164c('0x20')](_0x3f84d7);}return _0x2dc406['save']();};}function saveUpdates(_0x4f485d,_0x1286db){return function(_0x3d1f3c){if(_0x3d1f3c){return _0x3d1f3c[_0x164c('0x21')](_0x4f485d)[_0x164c('0x22')](function(_0x11901d){return _0x11901d;});}return null;};}function removeEntity(_0x3c6f6c,_0x57f540){return function(_0x10f7fa){if(_0x10f7fa){return _0x10f7fa[_0x164c('0x23')]()[_0x164c('0x22')](function(){var _0x2bcd2f=_0x10f7fa['get']({'plain':!![]});var _0x3b558f=_0x164c('0x24');return db['UserProfileResource'][_0x164c('0x23')]({'where':{'type':_0x3b558f,'resourceId':_0x2bcd2f['id']}})[_0x164c('0x22')](function(){return _0x10f7fa;});})[_0x164c('0x22')](function(){_0x3c6f6c[_0x164c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18e2d1,_0x3c7c08){return function(_0x4307c6){if(!_0x4307c6){_0x18e2d1['sendStatus'](0x194);}return _0x4307c6;};}function handleError(_0x539ffd,_0x1075e5){_0x1075e5=_0x1075e5||0x1f4;return function(_0x385878){logger[_0x164c('0x25')](_0x385878['stack']);if(_0x385878['name']){delete _0x385878[_0x164c('0x26')];}_0x539ffd[_0x164c('0x17')](_0x1075e5)['send'](_0x385878);};}exports[_0x164c('0x27')]=function(_0x32e51e,_0x3ad56f){var _0x19638d={},_0x32af58={},_0x3b0557={'count':0x0,'rows':[]};var _0x3b5301=_[_0x164c('0x28')](db[_0x164c('0x29')][_0x164c('0x2a')],function(_0x472bdc){return{'name':_0x472bdc[_0x164c('0x2b')],'type':_0x472bdc['type'][_0x164c('0x2c')]};});_0x32af58[_0x164c('0x2d')]=_[_0x164c('0x28')](_0x3b5301,'name');_0x32af58['query']=_['keys'](_0x32e51e[_0x164c('0x2e')]);_0x32af58['filters']=_[_0x164c('0x2f')](_0x32af58[_0x164c('0x2d')],_0x32af58[_0x164c('0x2e')]);_0x19638d['attributes']=_[_0x164c('0x2f')](_0x32af58['model'],qs[_0x164c('0x30')](_0x32e51e['query'][_0x164c('0x30')]));_0x19638d[_0x164c('0x31')]=_0x19638d[_0x164c('0x31')][_0x164c('0x32')]?_0x19638d['attributes']:_0x32af58[_0x164c('0x2d')];if(!_0x32e51e[_0x164c('0x2e')][_0x164c('0x33')](_0x164c('0x34'))){_0x19638d[_0x164c('0x1b')]=qs[_0x164c('0x1b')](_0x32e51e['query'][_0x164c('0x1b')]);_0x19638d['offset']=qs[_0x164c('0x19')](_0x32e51e['query']['offset']);}_0x19638d[_0x164c('0x35')]=qs[_0x164c('0x36')](_0x32e51e[_0x164c('0x2e')]['sort']);_0x19638d[_0x164c('0x37')]=qs['filters'](_[_0x164c('0x38')](_0x32e51e[_0x164c('0x2e')],_0x32af58[_0x164c('0x39')]),_0x3b5301);if(_0x32e51e[_0x164c('0x2e')][_0x164c('0x3a')]){_0x19638d[_0x164c('0x37')]=_[_0x164c('0x3b')](_0x19638d[_0x164c('0x37')],{'$or':_['map'](_0x3b5301,function(_0x1c8421){if(_0x1c8421['type']!==_0x164c('0x3c')){var _0x155a0b={};_0x155a0b[_0x1c8421[_0x164c('0x26')]]={'$like':'%'+_0x32e51e['query'][_0x164c('0x3a')]+'%'};return _0x155a0b;}})});}_0x19638d=_[_0x164c('0x3b')]({},_0x19638d,_0x32e51e['options']);var _0x4122af={'where':_0x19638d[_0x164c('0x37')]};return db[_0x164c('0x29')][_0x164c('0x1c')](_0x4122af)[_0x164c('0x22')](function(_0x510edf){_0x3b0557[_0x164c('0x1c')]=_0x510edf;if(_0x32e51e[_0x164c('0x2e')][_0x164c('0x3d')]){_0x19638d['include']=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x164c('0x3e')](_0x19638d);})[_0x164c('0x22')](function(_0x345ebe){_0x3b0557[_0x164c('0x3f')]=_0x345ebe;return _0x3b0557;})[_0x164c('0x22')](respondWithFilteredResult(_0x3ad56f,_0x19638d))['catch'](handleError(_0x3ad56f,null));};exports[_0x164c('0x40')]=function(_0x263c61,_0x3f3f75){var _0x314459={'raw':!![],'where':{'id':_0x263c61[_0x164c('0x41')]['id']}},_0x57439a={};_0x57439a['model']=_[_0x164c('0x42')](db[_0x164c('0x29')][_0x164c('0x2a')]);_0x57439a[_0x164c('0x2e')]=_[_0x164c('0x42')](_0x263c61[_0x164c('0x2e')]);_0x57439a['filters']=_[_0x164c('0x2f')](_0x57439a[_0x164c('0x2d')],_0x57439a[_0x164c('0x2e')]);_0x314459[_0x164c('0x31')]=_[_0x164c('0x2f')](_0x57439a[_0x164c('0x2d')],qs['fields'](_0x263c61[_0x164c('0x2e')][_0x164c('0x30')]));_0x314459[_0x164c('0x31')]=_0x314459[_0x164c('0x31')][_0x164c('0x32')]?_0x314459[_0x164c('0x31')]:_0x57439a[_0x164c('0x2d')];if(_0x263c61['query']['includeAll']){_0x314459['include']=[{'all':!![]}];}_0x314459=_['merge']({},_0x314459,_0x263c61[_0x164c('0x43')]);return db[_0x164c('0x29')][_0x164c('0x44')](_0x314459)[_0x164c('0x22')](handleEntityNotFound(_0x3f3f75,null))[_0x164c('0x22')](respondWithResult(_0x3f3f75,null))['catch'](handleError(_0x3f3f75,null));};exports[_0x164c('0x45')]=function(_0x1c47da,_0x47505d){return db[_0x164c('0x29')][_0x164c('0x45')](_0x1c47da['body'],{})[_0x164c('0x22')](function(_0x4754cc){var _0x4fac75=_0x1c47da['user']['get']({'plain':!![]});if(!_0x4fac75)throw new Error(_0x164c('0x46'));if(_0x4fac75[_0x164c('0x47')]===_0x164c('0x48')){var _0x54553d=_0x4754cc[_0x164c('0x49')]({'plain':!![]});var _0x48f140=_0x164c('0x24');return db[_0x164c('0x4a')][_0x164c('0x44')]({'where':{'name':_0x48f140,'userProfileId':_0x4fac75[_0x164c('0x4b')]},'raw':!![]})[_0x164c('0x22')](function(_0x2c065b){if(_0x2c065b&&_0x2c065b[_0x164c('0x4c')]===0x0){return db[_0x164c('0x4d')][_0x164c('0x45')]({'name':_0x54553d[_0x164c('0x26')],'resourceId':_0x54553d['id'],'type':_0x2c065b[_0x164c('0x26')],'sectionId':_0x2c065b['id']},{})[_0x164c('0x22')](function(){return _0x4754cc;});}else{return _0x4754cc;}})['catch'](function(_0x3011c1){logger[_0x164c('0x25')](_0x164c('0x4e'),_0x3011c1);throw _0x3011c1;});}return _0x4754cc;})[_0x164c('0x22')](respondWithResult(_0x47505d,0xc9))[_0x164c('0x4f')](handleError(_0x47505d,null));};exports[_0x164c('0x21')]=function(_0x21a77d,_0x5a7ebe){if(_0x21a77d[_0x164c('0x50')]['id']){delete _0x21a77d[_0x164c('0x50')]['id'];}return db['CmHopperAdditionalPhone'][_0x164c('0x44')]({'where':{'id':_0x21a77d[_0x164c('0x41')]['id']}})[_0x164c('0x22')](handleEntityNotFound(_0x5a7ebe,null))['then'](saveUpdates(_0x21a77d['body'],null))[_0x164c('0x22')](respondWithResult(_0x5a7ebe,null))[_0x164c('0x4f')](handleError(_0x5a7ebe,null));};exports[_0x164c('0x23')]=function(_0x158d4d,_0x1adc0a){return db[_0x164c('0x29')]['find']({'where':{'id':_0x158d4d[_0x164c('0x41')]['id']}})[_0x164c('0x22')](handleEntityNotFound(_0x1adc0a,null))[_0x164c('0x22')](removeEntity(_0x1adc0a,null))[_0x164c('0x4f')](handleError(_0x1adc0a,null));};
\ No newline at end of file