Built motion from commit e02f907f.|2.6.14
[motion2.git] / server / api / cmHopperAdditionalPhone / cmHopperAdditionalPhone.controller.js
index c34ff9c..d17fda0 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 _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