Built motion from commit e02f907f.|2.6.14
[motion2.git] / server / api / cmHopperAdditionalPhone / cmHopperAdditionalPhone.controller.js
index ae68fd1..d17fda0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7f8=['get','CmHopperAdditionalPhones','UserProfileResource','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','fields','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x2ca312,_0x564dd3){var _0xb88062=function(_0x12c7ad){while(--_0x12c7ad){_0x2ca312['push'](_0x2ca312['shift']());}};_0xb88062(++_0x564dd3);}(_0xa7f8,0x1bf));var _0x8a7f=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0xa7f8[_0x3f1710];return _0x528458;};'use strict';var emlformat=require(_0x8a7f('0x0'));var rimraf=require(_0x8a7f('0x1'));var zipdir=require(_0x8a7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a7f('0x3'));var moment=require('moment');var BPromise=require(_0x8a7f('0x4'));var Mustache=require(_0x8a7f('0x5'));var util=require(_0x8a7f('0x6'));var path=require(_0x8a7f('0x7'));var sox=require('sox');var csv=require(_0x8a7f('0x8'));var ejs=require(_0x8a7f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a7f('0xa'));var squel=require('squel');var crypto=require(_0x8a7f('0xb'));var jsforce=require(_0x8a7f('0xc'));var deskjs=require(_0x8a7f('0xd'));var toCsv=require(_0x8a7f('0x8'));var querystring=require(_0x8a7f('0xe'));var Papa=require('papaparse');var Redis=require(_0x8a7f('0xf'));var authService=require(_0x8a7f('0x10'));var qs=require(_0x8a7f('0x11'));var as=require(_0x8a7f('0x12'));var hardwareService=require(_0x8a7f('0x13'));var logger=require(_0x8a7f('0x14'))(_0x8a7f('0x15'));var utils=require('../../config/utils');var config=require(_0x8a7f('0x16'));var licenseUtil=require(_0x8a7f('0x17'));var db=require(_0x8a7f('0x18'))['db'];function respondWithStatusCode(_0x238803,_0x246de3){_0x246de3=_0x246de3||0xcc;return function(_0x56ee10){if(_0x56ee10){return _0x238803[_0x8a7f('0x19')](_0x246de3);}return _0x238803[_0x8a7f('0x1a')](_0x246de3)[_0x8a7f('0x1b')]();};}function respondWithResult(_0x548c2d,_0xc26843){_0xc26843=_0xc26843||0xc8;return function(_0x27062f){if(_0x27062f){return _0x548c2d[_0x8a7f('0x1a')](_0xc26843)[_0x8a7f('0x1c')](_0x27062f);}};}function respondWithFilteredResult(_0x3f9770,_0x187a90){return function(_0x1e0314){if(_0x1e0314){var _0x2d3a7c=typeof _0x187a90[_0x8a7f('0x1d')]==='undefined'&&typeof _0x187a90[_0x8a7f('0x1e')]==='undefined';var _0x363e7e=_0x1e0314[_0x8a7f('0x1f')];var _0x25992c=_0x2d3a7c?0x0:_0x187a90['offset'];var _0x2fb81c=_0x2d3a7c?_0x1e0314[_0x8a7f('0x1f')]:_0x187a90[_0x8a7f('0x1d')]+_0x187a90[_0x8a7f('0x1e')];var _0x173754;if(_0x2fb81c>=_0x363e7e){_0x2fb81c=_0x363e7e;_0x173754=0xc8;}else{_0x173754=0xce;}_0x3f9770[_0x8a7f('0x1a')](_0x173754);return _0x3f9770['set'](_0x8a7f('0x20'),_0x25992c+'-'+_0x2fb81c+'/'+_0x363e7e)[_0x8a7f('0x1c')](_0x1e0314);}return null;};}function patchUpdates(_0x2331d0){return function(_0x2cbfa6){try{jsonpatch[_0x8a7f('0x21')](_0x2cbfa6,_0x2331d0,!![]);}catch(_0x92fe7c){return BPromise[_0x8a7f('0x22')](_0x92fe7c);}return _0x2cbfa6[_0x8a7f('0x23')]();};}function saveUpdates(_0x105b64,_0x53ad74){return function(_0x5a4cb7){if(_0x5a4cb7){return _0x5a4cb7[_0x8a7f('0x24')](_0x105b64)[_0x8a7f('0x25')](function(_0x45b2c6){return _0x45b2c6;});}return null;};}function removeEntity(_0x5943be,_0x138c43){return function(_0x244c9b){if(_0x244c9b){return _0x244c9b[_0x8a7f('0x26')]()[_0x8a7f('0x25')](function(){var _0x30768f=_0x244c9b[_0x8a7f('0x27')]({'plain':!![]});var _0x18b6b6=_0x8a7f('0x28');return db[_0x8a7f('0x29')]['destroy']({'where':{'type':_0x18b6b6,'resourceId':_0x30768f['id']}})[_0x8a7f('0x25')](function(){return _0x244c9b;});})[_0x8a7f('0x25')](function(){_0x5943be['status'](0xcc)[_0x8a7f('0x1b')]();});}};}function handleEntityNotFound(_0x513c60,_0x12e5dc){return function(_0x55cf14){if(!_0x55cf14){_0x513c60[_0x8a7f('0x19')](0x194);}return _0x55cf14;};}function handleError(_0x2f70c4,_0x4030bb){_0x4030bb=_0x4030bb||0x1f4;return function(_0x1005ad){logger['error'](_0x1005ad['stack']);if(_0x1005ad[_0x8a7f('0x2a')]){delete _0x1005ad[_0x8a7f('0x2a')];}_0x2f70c4['status'](_0x4030bb)[_0x8a7f('0x2b')](_0x1005ad);};}exports[_0x8a7f('0x2c')]=function(_0x2fec55,_0x3eef8c){var _0x54969e={},_0x5349c3={},_0x27fd06={'count':0x0,'rows':[]};var _0x133f4d=_[_0x8a7f('0x2d')](db[_0x8a7f('0x2e')][_0x8a7f('0x2f')],function(_0x515c35){return{'name':_0x515c35[_0x8a7f('0x30')],'type':_0x515c35[_0x8a7f('0x31')][_0x8a7f('0x32')]};});_0x5349c3['model']=_[_0x8a7f('0x2d')](_0x133f4d,_0x8a7f('0x2a'));_0x5349c3[_0x8a7f('0x33')]=_['keys'](_0x2fec55[_0x8a7f('0x33')]);_0x5349c3[_0x8a7f('0x34')]=_[_0x8a7f('0x35')](_0x5349c3[_0x8a7f('0x36')],_0x5349c3[_0x8a7f('0x33')]);_0x54969e[_0x8a7f('0x37')]=_[_0x8a7f('0x35')](_0x5349c3['model'],qs['fields'](_0x2fec55[_0x8a7f('0x33')]['fields']));_0x54969e[_0x8a7f('0x37')]=_0x54969e[_0x8a7f('0x37')][_0x8a7f('0x38')]?_0x54969e[_0x8a7f('0x37')]:_0x5349c3['model'];if(!_0x2fec55['query']['hasOwnProperty'](_0x8a7f('0x39'))){_0x54969e['limit']=qs[_0x8a7f('0x1e')](_0x2fec55[_0x8a7f('0x33')]['limit']);_0x54969e[_0x8a7f('0x1d')]=qs[_0x8a7f('0x1d')](_0x2fec55['query']['offset']);}_0x54969e[_0x8a7f('0x3a')]=qs[_0x8a7f('0x3b')](_0x2fec55[_0x8a7f('0x33')][_0x8a7f('0x3b')]);_0x54969e['where']=qs[_0x8a7f('0x34')](_[_0x8a7f('0x3c')](_0x2fec55['query'],_0x5349c3[_0x8a7f('0x34')]),_0x133f4d);if(_0x2fec55[_0x8a7f('0x33')][_0x8a7f('0x3d')]){_0x54969e[_0x8a7f('0x3e')]=_['merge'](_0x54969e['where'],{'$or':_[_0x8a7f('0x2d')](_0x133f4d,function(_0x319ab6){if(_0x319ab6[_0x8a7f('0x31')]!==_0x8a7f('0x3f')){var _0x414dc2={};_0x414dc2[_0x319ab6[_0x8a7f('0x2a')]]={'$like':'%'+_0x2fec55[_0x8a7f('0x33')]['filter']+'%'};return _0x414dc2;}})});}_0x54969e=_[_0x8a7f('0x40')]({},_0x54969e,_0x2fec55['options']);var _0x30a639={'where':_0x54969e[_0x8a7f('0x3e')]};return db[_0x8a7f('0x2e')][_0x8a7f('0x1f')](_0x30a639)['then'](function(_0x33c456){_0x27fd06['count']=_0x33c456;if(_0x2fec55[_0x8a7f('0x33')]['includeAll']){_0x54969e[_0x8a7f('0x41')]=[{'all':!![]}];}return db[_0x8a7f('0x2e')][_0x8a7f('0x42')](_0x54969e);})[_0x8a7f('0x25')](function(_0x5bddf4){_0x27fd06[_0x8a7f('0x43')]=_0x5bddf4;return _0x27fd06;})[_0x8a7f('0x25')](respondWithFilteredResult(_0x3eef8c,_0x54969e))[_0x8a7f('0x44')](handleError(_0x3eef8c,null));};exports[_0x8a7f('0x45')]=function(_0x4581ac,_0x30410c){var _0x562e53={'raw':!![],'where':{'id':_0x4581ac[_0x8a7f('0x46')]['id']}},_0x21053d={};_0x21053d[_0x8a7f('0x36')]=_[_0x8a7f('0x47')](db['CmHopperAdditionalPhone'][_0x8a7f('0x2f')]);_0x21053d[_0x8a7f('0x33')]=_['keys'](_0x4581ac[_0x8a7f('0x33')]);_0x21053d[_0x8a7f('0x34')]=_[_0x8a7f('0x35')](_0x21053d['model'],_0x21053d['query']);_0x562e53[_0x8a7f('0x37')]=_[_0x8a7f('0x35')](_0x21053d[_0x8a7f('0x36')],qs[_0x8a7f('0x48')](_0x4581ac[_0x8a7f('0x33')][_0x8a7f('0x48')]));_0x562e53[_0x8a7f('0x37')]=_0x562e53['attributes'][_0x8a7f('0x38')]?_0x562e53[_0x8a7f('0x37')]:_0x21053d[_0x8a7f('0x36')];if(_0x4581ac[_0x8a7f('0x33')]['includeAll']){_0x562e53[_0x8a7f('0x41')]=[{'all':!![]}];}_0x562e53=_['merge']({},_0x562e53,_0x4581ac[_0x8a7f('0x49')]);return db[_0x8a7f('0x2e')]['find'](_0x562e53)[_0x8a7f('0x25')](handleEntityNotFound(_0x30410c,null))[_0x8a7f('0x25')](respondWithResult(_0x30410c,null))[_0x8a7f('0x44')](handleError(_0x30410c,null));};exports['create']=function(_0x1b5772,_0x1ace11){return db[_0x8a7f('0x2e')][_0x8a7f('0x4a')](_0x1b5772[_0x8a7f('0x4b')],{})[_0x8a7f('0x25')](function(_0xd64f27){var _0x15a4c6=_0x1b5772['user'][_0x8a7f('0x27')]({'plain':!![]});if(!_0x15a4c6)throw new Error(_0x8a7f('0x4c'));if(_0x15a4c6['role']==='user'){var _0xf801f0=_0xd64f27[_0x8a7f('0x27')]({'plain':!![]});var _0x755fa7=_0x8a7f('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x755fa7,'userProfileId':_0x15a4c6[_0x8a7f('0x4d')]},'raw':!![]})[_0x8a7f('0x25')](function(_0x5909a6){if(_0x5909a6&&_0x5909a6[_0x8a7f('0x4e')]===0x0){return db[_0x8a7f('0x29')][_0x8a7f('0x4a')]({'name':_0xf801f0[_0x8a7f('0x2a')],'resourceId':_0xf801f0['id'],'type':_0x5909a6[_0x8a7f('0x2a')],'sectionId':_0x5909a6['id']},{})['then'](function(){return _0xd64f27;});}else{return _0xd64f27;}})['catch'](function(_0x5815ff){logger['error'](_0x8a7f('0x4f'),_0x5815ff);throw _0x5815ff;});}return _0xd64f27;})['then'](respondWithResult(_0x1ace11,0xc9))[_0x8a7f('0x44')](handleError(_0x1ace11,null));};exports[_0x8a7f('0x24')]=function(_0x14e329,_0xd66b33){if(_0x14e329[_0x8a7f('0x4b')]['id']){delete _0x14e329[_0x8a7f('0x4b')]['id'];}return db[_0x8a7f('0x2e')][_0x8a7f('0x50')]({'where':{'id':_0x14e329['params']['id']}})['then'](handleEntityNotFound(_0xd66b33,null))[_0x8a7f('0x25')](saveUpdates(_0x14e329[_0x8a7f('0x4b')],null))[_0x8a7f('0x25')](respondWithResult(_0xd66b33,null))[_0x8a7f('0x44')](handleError(_0xd66b33,null));};exports[_0x8a7f('0x26')]=function(_0x2b6c07,_0x466e32){return db[_0x8a7f('0x2e')][_0x8a7f('0x50')]({'where':{'id':_0x2b6c07['params']['id']}})['then'](handleEntityNotFound(_0x466e32,null))[_0x8a7f('0x25')](removeEntity(_0x466e32,null))[_0x8a7f('0x44')](handleError(_0x466e32,null));};
\ No newline at end of file
+var _0x39b1=['to-csv','fs-extra','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x5483ab,_0x544f56){var _0xbd99f4=function(_0x19578a){while(--_0x19578a){_0x5483ab['push'](_0x5483ab['shift']());}};_0xbd99f4(++_0x544f56);}(_0x39b1,0x190));var _0x139b=function(_0x417383,_0x1d8a41){_0x417383=_0x417383-0x0;var _0x3ed230=_0x39b1[_0x417383];return _0x3ed230;};'use strict';var emlformat=require(_0x139b('0x0'));var rimraf=require(_0x139b('0x1'));var zipdir=require(_0x139b('0x2'));var jsonpatch=require(_0x139b('0x3'));var rp=require(_0x139b('0x4'));var moment=require(_0x139b('0x5'));var BPromise=require(_0x139b('0x6'));var Mustache=require(_0x139b('0x7'));var util=require('util');var path=require(_0x139b('0x8'));var sox=require(_0x139b('0x9'));var csv=require(_0x139b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x139b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x139b('0xc'));var deskjs=require(_0x139b('0xd'));var toCsv=require(_0x139b('0xa'));var querystring=require(_0x139b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x139b('0xf'));var qs=require(_0x139b('0x10'));var as=require(_0x139b('0x11'));var hardwareService=require(_0x139b('0x12'));var logger=require(_0x139b('0x13'))('api');var utils=require(_0x139b('0x14'));var config=require(_0x139b('0x15'));var licenseUtil=require(_0x139b('0x16'));var db=require(_0x139b('0x17'))['db'];function respondWithStatusCode(_0x4ba91a,_0x29df43){_0x29df43=_0x29df43||0xcc;return function(_0x303cb5){if(_0x303cb5){return _0x4ba91a[_0x139b('0x18')](_0x29df43);}return _0x4ba91a[_0x139b('0x19')](_0x29df43)[_0x139b('0x1a')]();};}function respondWithResult(_0x4463b4,_0x1e4e59){_0x1e4e59=_0x1e4e59||0xc8;return function(_0x450d16){if(_0x450d16){return _0x4463b4[_0x139b('0x19')](_0x1e4e59)[_0x139b('0x1b')](_0x450d16);}};}function respondWithFilteredResult(_0x272752,_0x149685){return function(_0x49a2d0){if(_0x49a2d0){var _0xedc6e6=typeof _0x149685[_0x139b('0x1c')]===_0x139b('0x1d')&&typeof _0x149685[_0x139b('0x1e')]==='undefined';var _0x104da6=_0x49a2d0[_0x139b('0x1f')];var _0x56d36f=_0xedc6e6?0x0:_0x149685[_0x139b('0x1c')];var _0x557edf=_0xedc6e6?_0x49a2d0[_0x139b('0x1f')]:_0x149685['offset']+_0x149685[_0x139b('0x1e')];var _0x209795;if(_0x557edf>=_0x104da6){_0x557edf=_0x104da6;_0x209795=0xc8;}else{_0x209795=0xce;}_0x272752[_0x139b('0x19')](_0x209795);return _0x272752[_0x139b('0x20')]('Content-Range',_0x56d36f+'-'+_0x557edf+'/'+_0x104da6)[_0x139b('0x1b')](_0x49a2d0);}return null;};}function patchUpdates(_0x482f39){return function(_0x4b8a25){try{jsonpatch['apply'](_0x4b8a25,_0x482f39,!![]);}catch(_0x35c4f4){return BPromise['reject'](_0x35c4f4);}return _0x4b8a25[_0x139b('0x21')]();};}function saveUpdates(_0x846924,_0x2f4582){return function(_0x28f4f5){if(_0x28f4f5){return _0x28f4f5[_0x139b('0x22')](_0x846924)['then'](function(_0x563f44){return _0x563f44;});}return null;};}function removeEntity(_0x5b7dbd,_0x38b923){return function(_0x476ad8){if(_0x476ad8){return _0x476ad8['destroy']()[_0x139b('0x23')](function(){var _0x230adf=_0x476ad8[_0x139b('0x24')]({'plain':!![]});var _0x18b3de=_0x139b('0x25');return db[_0x139b('0x26')]['destroy']({'where':{'type':_0x18b3de,'resourceId':_0x230adf['id']}})[_0x139b('0x23')](function(){return _0x476ad8;});})['then'](function(){_0x5b7dbd['status'](0xcc)[_0x139b('0x1a')]();});}};}function handleEntityNotFound(_0x2ddea9,_0x2e230d){return function(_0x8f6677){if(!_0x8f6677){_0x2ddea9['sendStatus'](0x194);}return _0x8f6677;};}function handleError(_0x1ef57a,_0x3b4769){_0x3b4769=_0x3b4769||0x1f4;return function(_0x5c80dc){logger[_0x139b('0x27')](_0x5c80dc[_0x139b('0x28')]);if(_0x5c80dc[_0x139b('0x29')]){delete _0x5c80dc[_0x139b('0x29')];}_0x1ef57a['status'](_0x3b4769)[_0x139b('0x2a')](_0x5c80dc);};}exports[_0x139b('0x2b')]=function(_0x3707e9,_0x42fddf){var _0x2568c0={},_0x21c55d={},_0x216059={'count':0x0,'rows':[]};var _0x42d788=_[_0x139b('0x2c')](db[_0x139b('0x2d')][_0x139b('0x2e')],function(_0x1b1c66){return{'name':_0x1b1c66[_0x139b('0x2f')],'type':_0x1b1c66[_0x139b('0x30')][_0x139b('0x31')]};});_0x21c55d['model']=_[_0x139b('0x2c')](_0x42d788,'name');_0x21c55d[_0x139b('0x32')]=_[_0x139b('0x33')](_0x3707e9[_0x139b('0x32')]);_0x21c55d['filters']=_['intersection'](_0x21c55d[_0x139b('0x34')],_0x21c55d[_0x139b('0x32')]);_0x2568c0[_0x139b('0x35')]=_['intersection'](_0x21c55d['model'],qs[_0x139b('0x36')](_0x3707e9[_0x139b('0x32')]['fields']));_0x2568c0[_0x139b('0x35')]=_0x2568c0[_0x139b('0x35')][_0x139b('0x37')]?_0x2568c0[_0x139b('0x35')]:_0x21c55d['model'];if(!_0x3707e9['query']['hasOwnProperty'](_0x139b('0x38'))){_0x2568c0[_0x139b('0x1e')]=qs[_0x139b('0x1e')](_0x3707e9[_0x139b('0x32')][_0x139b('0x1e')]);_0x2568c0[_0x139b('0x1c')]=qs[_0x139b('0x1c')](_0x3707e9['query'][_0x139b('0x1c')]);}_0x2568c0[_0x139b('0x39')]=qs['sort'](_0x3707e9[_0x139b('0x32')][_0x139b('0x3a')]);_0x2568c0[_0x139b('0x3b')]=qs[_0x139b('0x3c')](_['pick'](_0x3707e9[_0x139b('0x32')],_0x21c55d[_0x139b('0x3c')]),_0x42d788);if(_0x3707e9[_0x139b('0x32')]['filter']){_0x2568c0[_0x139b('0x3b')]=_['merge'](_0x2568c0[_0x139b('0x3b')],{'$or':_[_0x139b('0x2c')](_0x42d788,function(_0x20aa43){if(_0x20aa43[_0x139b('0x30')]!=='VIRTUAL'){var _0x3deb38={};_0x3deb38[_0x20aa43[_0x139b('0x29')]]={'$like':'%'+_0x3707e9[_0x139b('0x32')][_0x139b('0x3d')]+'%'};return _0x3deb38;}})});}_0x2568c0=_['merge']({},_0x2568c0,_0x3707e9[_0x139b('0x3e')]);var _0x2a2884={'where':_0x2568c0[_0x139b('0x3b')]};return db['CmHopperAdditionalPhone'][_0x139b('0x1f')](_0x2a2884)[_0x139b('0x23')](function(_0x3f81d0){_0x216059[_0x139b('0x1f')]=_0x3f81d0;if(_0x3707e9[_0x139b('0x32')][_0x139b('0x3f')]){_0x2568c0[_0x139b('0x40')]=[{'all':!![]}];}return db[_0x139b('0x2d')][_0x139b('0x41')](_0x2568c0);})['then'](function(_0x5a88d6){_0x216059[_0x139b('0x42')]=_0x5a88d6;return _0x216059;})['then'](respondWithFilteredResult(_0x42fddf,_0x2568c0))[_0x139b('0x43')](handleError(_0x42fddf,null));};exports[_0x139b('0x44')]=function(_0x4613ca,_0x67ca23){var _0x3f5c0d={'raw':!![],'where':{'id':_0x4613ca[_0x139b('0x45')]['id']}},_0x3e1a6a={};_0x3e1a6a['model']=_[_0x139b('0x33')](db[_0x139b('0x2d')][_0x139b('0x2e')]);_0x3e1a6a[_0x139b('0x32')]=_[_0x139b('0x33')](_0x4613ca[_0x139b('0x32')]);_0x3e1a6a[_0x139b('0x3c')]=_['intersection'](_0x3e1a6a[_0x139b('0x34')],_0x3e1a6a['query']);_0x3f5c0d[_0x139b('0x35')]=_[_0x139b('0x46')](_0x3e1a6a[_0x139b('0x34')],qs[_0x139b('0x36')](_0x4613ca[_0x139b('0x32')][_0x139b('0x36')]));_0x3f5c0d[_0x139b('0x35')]=_0x3f5c0d[_0x139b('0x35')]['length']?_0x3f5c0d[_0x139b('0x35')]:_0x3e1a6a[_0x139b('0x34')];if(_0x4613ca[_0x139b('0x32')][_0x139b('0x3f')]){_0x3f5c0d[_0x139b('0x40')]=[{'all':!![]}];}_0x3f5c0d=_[_0x139b('0x47')]({},_0x3f5c0d,_0x4613ca['options']);return db['CmHopperAdditionalPhone'][_0x139b('0x48')](_0x3f5c0d)[_0x139b('0x23')](handleEntityNotFound(_0x67ca23,null))['then'](respondWithResult(_0x67ca23,null))[_0x139b('0x43')](handleError(_0x67ca23,null));};exports[_0x139b('0x49')]=function(_0x37031a,_0x3ee920){return db['CmHopperAdditionalPhone'][_0x139b('0x49')](_0x37031a[_0x139b('0x4a')],{})['then'](function(_0x48a1ce){var _0x19754c=_0x37031a['user'][_0x139b('0x24')]({'plain':!![]});if(!_0x19754c)throw new Error(_0x139b('0x4b'));if(_0x19754c[_0x139b('0x4c')]===_0x139b('0x4d')){var _0x36a2dd=_0x48a1ce[_0x139b('0x24')]({'plain':!![]});var _0x4a34d5='CmHopperAdditionalPhones';return db[_0x139b('0x4e')][_0x139b('0x48')]({'where':{'name':_0x4a34d5,'userProfileId':_0x19754c[_0x139b('0x4f')]},'raw':!![]})[_0x139b('0x23')](function(_0x2f979b){if(_0x2f979b&&_0x2f979b[_0x139b('0x50')]===0x0){return db[_0x139b('0x26')][_0x139b('0x49')]({'name':_0x36a2dd[_0x139b('0x29')],'resourceId':_0x36a2dd['id'],'type':_0x2f979b[_0x139b('0x29')],'sectionId':_0x2f979b['id']},{})[_0x139b('0x23')](function(){return _0x48a1ce;});}else{return _0x48a1ce;}})['catch'](function(_0x4cffba){logger[_0x139b('0x27')](_0x139b('0x51'),_0x4cffba);throw _0x4cffba;});}return _0x48a1ce;})['then'](respondWithResult(_0x3ee920,0xc9))[_0x139b('0x43')](handleError(_0x3ee920,null));};exports[_0x139b('0x22')]=function(_0x1b82d0,_0x4daef2){if(_0x1b82d0['body']['id']){delete _0x1b82d0[_0x139b('0x4a')]['id'];}return db['CmHopperAdditionalPhone'][_0x139b('0x48')]({'where':{'id':_0x1b82d0[_0x139b('0x45')]['id']}})[_0x139b('0x23')](handleEntityNotFound(_0x4daef2,null))[_0x139b('0x23')](saveUpdates(_0x1b82d0[_0x139b('0x4a')],null))[_0x139b('0x23')](respondWithResult(_0x4daef2,null))[_0x139b('0x43')](handleError(_0x4daef2,null));};exports['destroy']=function(_0x25a9f2,_0x376016){return db[_0x139b('0x2d')]['find']({'where':{'id':_0x25a9f2[_0x139b('0x45')]['id']}})[_0x139b('0x23')](handleEntityNotFound(_0x376016,null))[_0x139b('0x23')](removeEntity(_0x376016,null))['catch'](handleError(_0x376016,null));};
\ No newline at end of file