Built motion from commit a679711e.|2.6.15
[motion2.git] / server / api / cmHopperAdditionalPhone / cmHopperAdditionalPhone.controller.js
index 425ddac..2adecb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3374=['options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','attributes','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','CmHopperAdditionalPhones','error','stack','name','send','CmHopperAdditionalPhone','key','map','query','keys','filters','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter'];(function(_0x98b160,_0x4f7f70){var _0x9c786e=function(_0x35fa33){while(--_0x35fa33){_0x98b160['push'](_0x98b160['shift']());}};_0x9c786e(++_0x4f7f70);}(_0x3374,0x64));var _0x4337=function(_0x146384,_0x2a01db){_0x146384=_0x146384-0x0;var _0x552a99=_0x3374[_0x146384];return _0x552a99;};'use strict';var emlformat=require(_0x4337('0x0'));var rimraf=require(_0x4337('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4337('0x2'));var moment=require('moment');var BPromise=require(_0x4337('0x3'));var Mustache=require(_0x4337('0x4'));var util=require(_0x4337('0x5'));var path=require('path');var sox=require(_0x4337('0x6'));var csv=require(_0x4337('0x7'));var ejs=require(_0x4337('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4337('0x9'));var squel=require(_0x4337('0xa'));var crypto=require(_0x4337('0xb'));var jsforce=require(_0x4337('0xc'));var deskjs=require(_0x4337('0xd'));var toCsv=require(_0x4337('0x7'));var querystring=require(_0x4337('0xe'));var Papa=require(_0x4337('0xf'));var Redis=require(_0x4337('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4337('0x11'));var logger=require(_0x4337('0x12'))(_0x4337('0x13'));var utils=require(_0x4337('0x14'));var config=require(_0x4337('0x15'));var licenseUtil=require(_0x4337('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x161ef6,_0x284ba1){_0x284ba1=_0x284ba1||0xcc;return function(_0x56d199){if(_0x56d199){return _0x161ef6[_0x4337('0x17')](_0x284ba1);}return _0x161ef6[_0x4337('0x18')](_0x284ba1)[_0x4337('0x19')]();};}function respondWithResult(_0x3b3348,_0x468c36){_0x468c36=_0x468c36||0xc8;return function(_0x2671af){if(_0x2671af){return _0x3b3348[_0x4337('0x18')](_0x468c36)[_0x4337('0x1a')](_0x2671af);}};}function respondWithFilteredResult(_0x253ce0,_0x36123a){return function(_0xe61b6a){if(_0xe61b6a){var _0x529b30=typeof _0x36123a['offset']==='undefined'&&typeof _0x36123a[_0x4337('0x1b')]==='undefined';var _0x40215b=_0xe61b6a[_0x4337('0x1c')];var _0x5d7424=_0x529b30?0x0:_0x36123a['offset'];var _0x51e9c4=_0x529b30?_0xe61b6a[_0x4337('0x1c')]:_0x36123a[_0x4337('0x1d')]+_0x36123a[_0x4337('0x1b')];var _0x8fa880;if(_0x51e9c4>=_0x40215b){_0x51e9c4=_0x40215b;_0x8fa880=0xc8;}else{_0x8fa880=0xce;}_0x253ce0[_0x4337('0x18')](_0x8fa880);return _0x253ce0[_0x4337('0x1e')](_0x4337('0x1f'),_0x5d7424+'-'+_0x51e9c4+'/'+_0x40215b)[_0x4337('0x1a')](_0xe61b6a);}return null;};}function patchUpdates(_0x119854){return function(_0x49e0fb){try{jsonpatch[_0x4337('0x20')](_0x49e0fb,_0x119854,!![]);}catch(_0x4bd88a){return BPromise['reject'](_0x4bd88a);}return _0x49e0fb[_0x4337('0x21')]();};}function saveUpdates(_0x215ebb,_0x543a6c){return function(_0x36aa89){if(_0x36aa89){return _0x36aa89[_0x4337('0x22')](_0x215ebb)[_0x4337('0x23')](function(_0x2fafbf){return _0x2fafbf;});}return null;};}function removeEntity(_0xec8e64,_0xd3fa05){return function(_0x1ecddf){if(_0x1ecddf){return _0x1ecddf[_0x4337('0x24')]()[_0x4337('0x23')](function(){var _0x40429e=_0x1ecddf[_0x4337('0x25')]({'plain':!![]});var _0x34519e=_0x4337('0x26');return db['UserProfileResource'][_0x4337('0x24')]({'where':{'type':_0x34519e,'resourceId':_0x40429e['id']}})[_0x4337('0x23')](function(){return _0x1ecddf;});})[_0x4337('0x23')](function(){_0xec8e64[_0x4337('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27b5e0,_0x221ad0){return function(_0xbf5c5f){if(!_0xbf5c5f){_0x27b5e0[_0x4337('0x17')](0x194);}return _0xbf5c5f;};}function handleError(_0x2fa5e2,_0x20259f){_0x20259f=_0x20259f||0x1f4;return function(_0x2c860a){logger[_0x4337('0x27')](_0x2c860a[_0x4337('0x28')]);if(_0x2c860a[_0x4337('0x29')]){delete _0x2c860a[_0x4337('0x29')];}_0x2fa5e2[_0x4337('0x18')](_0x20259f)[_0x4337('0x2a')](_0x2c860a);};}exports['index']=function(_0x320773,_0x163ecc){var _0x3f371a={},_0x170a68={},_0x5ec906={'count':0x0,'rows':[]};var _0x1c68c7=_['map'](db[_0x4337('0x2b')]['rawAttributes'],function(_0x1570ca){return{'name':_0x1570ca['fieldName'],'type':_0x1570ca['type'][_0x4337('0x2c')]};});_0x170a68['model']=_[_0x4337('0x2d')](_0x1c68c7,'name');_0x170a68[_0x4337('0x2e')]=_[_0x4337('0x2f')](_0x320773['query']);_0x170a68[_0x4337('0x30')]=_['intersection'](_0x170a68['model'],_0x170a68[_0x4337('0x2e')]);_0x3f371a['attributes']=_[_0x4337('0x31')](_0x170a68[_0x4337('0x32')],qs[_0x4337('0x33')](_0x320773[_0x4337('0x2e')][_0x4337('0x33')]));_0x3f371a['attributes']=_0x3f371a['attributes'][_0x4337('0x34')]?_0x3f371a['attributes']:_0x170a68[_0x4337('0x32')];if(!_0x320773[_0x4337('0x2e')][_0x4337('0x35')](_0x4337('0x36'))){_0x3f371a[_0x4337('0x1b')]=qs[_0x4337('0x1b')](_0x320773[_0x4337('0x2e')][_0x4337('0x1b')]);_0x3f371a[_0x4337('0x1d')]=qs[_0x4337('0x1d')](_0x320773[_0x4337('0x2e')]['offset']);}_0x3f371a[_0x4337('0x37')]=qs[_0x4337('0x38')](_0x320773[_0x4337('0x2e')][_0x4337('0x38')]);_0x3f371a[_0x4337('0x39')]=qs[_0x4337('0x30')](_['pick'](_0x320773[_0x4337('0x2e')],_0x170a68[_0x4337('0x30')]),_0x1c68c7);if(_0x320773[_0x4337('0x2e')]['filter']){_0x3f371a[_0x4337('0x39')]=_[_0x4337('0x3a')](_0x3f371a['where'],{'$or':_[_0x4337('0x2d')](_0x1c68c7,function(_0x5f13df){if(_0x5f13df[_0x4337('0x3b')]!==_0x4337('0x3c')){var _0x4a5f6a={};_0x4a5f6a[_0x5f13df[_0x4337('0x29')]]={'$like':'%'+_0x320773['query'][_0x4337('0x3d')]+'%'};return _0x4a5f6a;}})});}_0x3f371a=_[_0x4337('0x3a')]({},_0x3f371a,_0x320773[_0x4337('0x3e')]);var _0x374dab={'where':_0x3f371a[_0x4337('0x39')]};return db[_0x4337('0x2b')]['count'](_0x374dab)[_0x4337('0x23')](function(_0x4899f4){_0x5ec906['count']=_0x4899f4;if(_0x320773[_0x4337('0x2e')][_0x4337('0x3f')]){_0x3f371a[_0x4337('0x40')]=[{'all':!![]}];}return db[_0x4337('0x2b')][_0x4337('0x41')](_0x3f371a);})['then'](function(_0x6381d8){_0x5ec906[_0x4337('0x42')]=_0x6381d8;return _0x5ec906;})['then'](respondWithFilteredResult(_0x163ecc,_0x3f371a))[_0x4337('0x43')](handleError(_0x163ecc,null));};exports[_0x4337('0x44')]=function(_0x203284,_0x5d0b92){var _0x3a5eb1={'raw':!![],'where':{'id':_0x203284[_0x4337('0x45')]['id']}},_0x1363d2={};_0x1363d2[_0x4337('0x32')]=_[_0x4337('0x2f')](db[_0x4337('0x2b')][_0x4337('0x46')]);_0x1363d2[_0x4337('0x2e')]=_['keys'](_0x203284[_0x4337('0x2e')]);_0x1363d2[_0x4337('0x30')]=_[_0x4337('0x31')](_0x1363d2[_0x4337('0x32')],_0x1363d2[_0x4337('0x2e')]);_0x3a5eb1['attributes']=_[_0x4337('0x31')](_0x1363d2[_0x4337('0x32')],qs[_0x4337('0x33')](_0x203284[_0x4337('0x2e')][_0x4337('0x33')]));_0x3a5eb1['attributes']=_0x3a5eb1[_0x4337('0x47')][_0x4337('0x34')]?_0x3a5eb1['attributes']:_0x1363d2['model'];if(_0x203284[_0x4337('0x2e')]['includeAll']){_0x3a5eb1['include']=[{'all':!![]}];}_0x3a5eb1=_[_0x4337('0x3a')]({},_0x3a5eb1,_0x203284[_0x4337('0x3e')]);return db['CmHopperAdditionalPhone']['find'](_0x3a5eb1)[_0x4337('0x23')](handleEntityNotFound(_0x5d0b92,null))[_0x4337('0x23')](respondWithResult(_0x5d0b92,null))['catch'](handleError(_0x5d0b92,null));};exports[_0x4337('0x48')]=function(_0x356e2c,_0x614e90){return db['CmHopperAdditionalPhone'][_0x4337('0x48')](_0x356e2c[_0x4337('0x49')],{})[_0x4337('0x23')](function(_0xa2c22c){var _0xfd35f6=_0x356e2c[_0x4337('0x4a')][_0x4337('0x25')]({'plain':!![]});if(!_0xfd35f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfd35f6[_0x4337('0x4b')]===_0x4337('0x4a')){var _0x450a6c=_0xa2c22c[_0x4337('0x25')]({'plain':!![]});var _0x13c202=_0x4337('0x26');return db[_0x4337('0x4c')][_0x4337('0x4d')]({'where':{'name':_0x13c202,'userProfileId':_0xfd35f6[_0x4337('0x4e')]},'raw':!![]})[_0x4337('0x23')](function(_0x4809d3){if(_0x4809d3&&_0x4809d3[_0x4337('0x4f')]===0x0){return db['UserProfileResource'][_0x4337('0x48')]({'name':_0x450a6c['name'],'resourceId':_0x450a6c['id'],'type':_0x4809d3[_0x4337('0x29')],'sectionId':_0x4809d3['id']},{})['then'](function(){return _0xa2c22c;});}else{return _0xa2c22c;}})[_0x4337('0x43')](function(_0x10a2b0){logger[_0x4337('0x27')](_0x4337('0x50'),_0x10a2b0);throw _0x10a2b0;});}return _0xa2c22c;})['then'](respondWithResult(_0x614e90,0xc9))[_0x4337('0x43')](handleError(_0x614e90,null));};exports[_0x4337('0x22')]=function(_0x1dbd2a,_0x23f565){if(_0x1dbd2a[_0x4337('0x49')]['id']){delete _0x1dbd2a[_0x4337('0x49')]['id'];}return db[_0x4337('0x2b')]['find']({'where':{'id':_0x1dbd2a['params']['id']}})['then'](handleEntityNotFound(_0x23f565,null))[_0x4337('0x23')](saveUpdates(_0x1dbd2a['body'],null))[_0x4337('0x23')](respondWithResult(_0x23f565,null))[_0x4337('0x43')](handleError(_0x23f565,null));};exports[_0x4337('0x24')]=function(_0x241b25,_0x1d68b4){return db[_0x4337('0x2b')]['find']({'where':{'id':_0x241b25[_0x4337('0x45')]['id']}})[_0x4337('0x23')](handleEntityNotFound(_0x1d68b4,null))[_0x4337('0x23')](removeEntity(_0x1d68b4,null))['catch'](handleError(_0x1d68b4,null));};
\ No newline at end of file
+var _0xde01=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','update','destroy','then','get','UserProfileResource','end','error','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','show','params','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CmHopperAdditionalPhones','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2d639b,_0x5767e8){var _0x1016ec=function(_0x180f92){while(--_0x180f92){_0x2d639b['push'](_0x2d639b['shift']());}};_0x1016ec(++_0x5767e8);}(_0xde01,0x190));var _0x1de0=function(_0x29e620,_0x17687d){_0x29e620=_0x29e620-0x0;var _0x170958=_0xde01[_0x29e620];return _0x170958;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1de0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1de0('0x1'));var rp=require(_0x1de0('0x2'));var moment=require(_0x1de0('0x3'));var BPromise=require(_0x1de0('0x4'));var Mustache=require(_0x1de0('0x5'));var util=require(_0x1de0('0x6'));var path=require(_0x1de0('0x7'));var sox=require(_0x1de0('0x8'));var csv=require(_0x1de0('0x9'));var ejs=require(_0x1de0('0xa'));var fs=require('fs');var fs_extra=require(_0x1de0('0xb'));var _=require(_0x1de0('0xc'));var squel=require(_0x1de0('0xd'));var crypto=require(_0x1de0('0xe'));var jsforce=require(_0x1de0('0xf'));var deskjs=require(_0x1de0('0x10'));var toCsv=require(_0x1de0('0x9'));var querystring=require(_0x1de0('0x11'));var Papa=require('papaparse');var Redis=require(_0x1de0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1de0('0x13'));var as=require(_0x1de0('0x14'));var hardwareService=require(_0x1de0('0x15'));var logger=require(_0x1de0('0x16'))(_0x1de0('0x17'));var utils=require('../../config/utils');var config=require(_0x1de0('0x18'));var licenseUtil=require(_0x1de0('0x19'));var db=require(_0x1de0('0x1a'))['db'];function respondWithStatusCode(_0x443d82,_0x4a06ca){_0x4a06ca=_0x4a06ca||0xcc;return function(_0x4c9429){if(_0x4c9429){return _0x443d82[_0x1de0('0x1b')](_0x4a06ca);}return _0x443d82[_0x1de0('0x1c')](_0x4a06ca)['end']();};}function respondWithResult(_0x5624cf,_0x19403c){_0x19403c=_0x19403c||0xc8;return function(_0x1e9758){if(_0x1e9758){return _0x5624cf[_0x1de0('0x1c')](_0x19403c)[_0x1de0('0x1d')](_0x1e9758);}};}function respondWithFilteredResult(_0x45f839,_0x1968c2){return function(_0x1bd4a7){if(_0x1bd4a7){var _0x1ff58e=typeof _0x1968c2[_0x1de0('0x1e')]===_0x1de0('0x1f')&&typeof _0x1968c2['limit']===_0x1de0('0x1f');var _0x18b575=_0x1bd4a7['count'];var _0x24c9b6=_0x1ff58e?0x0:_0x1968c2[_0x1de0('0x1e')];var _0x1ed246=_0x1ff58e?_0x1bd4a7['count']:_0x1968c2[_0x1de0('0x1e')]+_0x1968c2[_0x1de0('0x20')];var _0x5a6f4f;if(_0x1ed246>=_0x18b575){_0x1ed246=_0x18b575;_0x5a6f4f=0xc8;}else{_0x5a6f4f=0xce;}_0x45f839['status'](_0x5a6f4f);return _0x45f839[_0x1de0('0x21')](_0x1de0('0x22'),_0x24c9b6+'-'+_0x1ed246+'/'+_0x18b575)['json'](_0x1bd4a7);}return null;};}function patchUpdates(_0x451a72){return function(_0x5c3313){try{jsonpatch['apply'](_0x5c3313,_0x451a72,!![]);}catch(_0x1a534b){return BPromise[_0x1de0('0x23')](_0x1a534b);}return _0x5c3313['save']();};}function saveUpdates(_0x13142c,_0x29c855){return function(_0x251421){if(_0x251421){return _0x251421[_0x1de0('0x24')](_0x13142c)['then'](function(_0x1eaaac){return _0x1eaaac;});}return null;};}function removeEntity(_0x4b22be,_0xae0251){return function(_0x110438){if(_0x110438){return _0x110438[_0x1de0('0x25')]()[_0x1de0('0x26')](function(){var _0x4a0433=_0x110438[_0x1de0('0x27')]({'plain':!![]});var _0xca53cd='CmHopperAdditionalPhones';return db[_0x1de0('0x28')][_0x1de0('0x25')]({'where':{'type':_0xca53cd,'resourceId':_0x4a0433['id']}})['then'](function(){return _0x110438;});})['then'](function(){_0x4b22be['status'](0xcc)[_0x1de0('0x29')]();});}};}function handleEntityNotFound(_0x174984,_0x3be2b5){return function(_0xecd6b0){if(!_0xecd6b0){_0x174984[_0x1de0('0x1b')](0x194);}return _0xecd6b0;};}function handleError(_0x26fa1c,_0x3e32e7){_0x3e32e7=_0x3e32e7||0x1f4;return function(_0x5d8549){logger[_0x1de0('0x2a')](_0x5d8549['stack']);if(_0x5d8549['name']){delete _0x5d8549['name'];}_0x26fa1c[_0x1de0('0x1c')](_0x3e32e7)[_0x1de0('0x2b')](_0x5d8549);};}exports[_0x1de0('0x2c')]=function(_0x1744ec,_0x8aeb53){var _0x1bbe79={},_0x45e555={},_0x1b5292={'count':0x0,'rows':[]};var _0x51ea76=_[_0x1de0('0x2d')](db[_0x1de0('0x2e')][_0x1de0('0x2f')],function(_0x54b2bb){return{'name':_0x54b2bb[_0x1de0('0x30')],'type':_0x54b2bb[_0x1de0('0x31')][_0x1de0('0x32')]};});_0x45e555[_0x1de0('0x33')]=_[_0x1de0('0x2d')](_0x51ea76,_0x1de0('0x34'));_0x45e555[_0x1de0('0x35')]=_[_0x1de0('0x36')](_0x1744ec[_0x1de0('0x35')]);_0x45e555['filters']=_[_0x1de0('0x37')](_0x45e555[_0x1de0('0x33')],_0x45e555[_0x1de0('0x35')]);_0x1bbe79[_0x1de0('0x38')]=_['intersection'](_0x45e555[_0x1de0('0x33')],qs['fields'](_0x1744ec[_0x1de0('0x35')]['fields']));_0x1bbe79[_0x1de0('0x38')]=_0x1bbe79['attributes'][_0x1de0('0x39')]?_0x1bbe79['attributes']:_0x45e555[_0x1de0('0x33')];if(!_0x1744ec[_0x1de0('0x35')][_0x1de0('0x3a')]('nolimit')){_0x1bbe79['limit']=qs[_0x1de0('0x20')](_0x1744ec['query'][_0x1de0('0x20')]);_0x1bbe79[_0x1de0('0x1e')]=qs['offset'](_0x1744ec[_0x1de0('0x35')]['offset']);}_0x1bbe79['order']=qs[_0x1de0('0x3b')](_0x1744ec[_0x1de0('0x35')]['sort']);_0x1bbe79[_0x1de0('0x3c')]=qs[_0x1de0('0x3d')](_[_0x1de0('0x3e')](_0x1744ec[_0x1de0('0x35')],_0x45e555['filters']),_0x51ea76);if(_0x1744ec[_0x1de0('0x35')][_0x1de0('0x3f')]){_0x1bbe79[_0x1de0('0x3c')]=_['merge'](_0x1bbe79[_0x1de0('0x3c')],{'$or':_['map'](_0x51ea76,function(_0x50e49a){if(_0x50e49a[_0x1de0('0x31')]!==_0x1de0('0x40')){var _0x4557a8={};_0x4557a8[_0x50e49a[_0x1de0('0x34')]]={'$like':'%'+_0x1744ec['query'][_0x1de0('0x3f')]+'%'};return _0x4557a8;}})});}_0x1bbe79=_[_0x1de0('0x41')]({},_0x1bbe79,_0x1744ec[_0x1de0('0x42')]);var _0x2f5211={'where':_0x1bbe79[_0x1de0('0x3c')]};return db[_0x1de0('0x2e')]['count'](_0x2f5211)[_0x1de0('0x26')](function(_0x159fcd){_0x1b5292[_0x1de0('0x43')]=_0x159fcd;if(_0x1744ec['query'][_0x1de0('0x44')]){_0x1bbe79[_0x1de0('0x45')]=[{'all':!![]}];}return db[_0x1de0('0x2e')][_0x1de0('0x46')](_0x1bbe79);})[_0x1de0('0x26')](function(_0x3dbf6b){_0x1b5292['rows']=_0x3dbf6b;return _0x1b5292;})[_0x1de0('0x26')](respondWithFilteredResult(_0x8aeb53,_0x1bbe79))['catch'](handleError(_0x8aeb53,null));};exports[_0x1de0('0x47')]=function(_0x4c0a72,_0x155e9){var _0x3ce57a={'raw':!![],'where':{'id':_0x4c0a72[_0x1de0('0x48')]['id']}},_0x32e084={};_0x32e084['model']=_[_0x1de0('0x36')](db[_0x1de0('0x2e')][_0x1de0('0x2f')]);_0x32e084[_0x1de0('0x35')]=_[_0x1de0('0x36')](_0x4c0a72[_0x1de0('0x35')]);_0x32e084[_0x1de0('0x3d')]=_[_0x1de0('0x37')](_0x32e084[_0x1de0('0x33')],_0x32e084[_0x1de0('0x35')]);_0x3ce57a[_0x1de0('0x38')]=_[_0x1de0('0x37')](_0x32e084[_0x1de0('0x33')],qs[_0x1de0('0x49')](_0x4c0a72[_0x1de0('0x35')][_0x1de0('0x49')]));_0x3ce57a['attributes']=_0x3ce57a['attributes'][_0x1de0('0x39')]?_0x3ce57a[_0x1de0('0x38')]:_0x32e084['model'];if(_0x4c0a72['query'][_0x1de0('0x44')]){_0x3ce57a[_0x1de0('0x45')]=[{'all':!![]}];}_0x3ce57a=_[_0x1de0('0x41')]({},_0x3ce57a,_0x4c0a72[_0x1de0('0x42')]);return db[_0x1de0('0x2e')][_0x1de0('0x4a')](_0x3ce57a)[_0x1de0('0x26')](handleEntityNotFound(_0x155e9,null))[_0x1de0('0x26')](respondWithResult(_0x155e9,null))['catch'](handleError(_0x155e9,null));};exports[_0x1de0('0x4b')]=function(_0x2ea1dc,_0xa9a1e5){return db['CmHopperAdditionalPhone'][_0x1de0('0x4b')](_0x2ea1dc[_0x1de0('0x4c')],{})[_0x1de0('0x26')](function(_0x5d14a3){var _0x4b6910=_0x2ea1dc['user'][_0x1de0('0x27')]({'plain':!![]});if(!_0x4b6910)throw new Error(_0x1de0('0x4d'));if(_0x4b6910[_0x1de0('0x4e')]===_0x1de0('0x4f')){var _0xa509f0=_0x5d14a3[_0x1de0('0x27')]({'plain':!![]});var _0x43dae9=_0x1de0('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x43dae9,'userProfileId':_0x4b6910['userProfileId']},'raw':!![]})['then'](function(_0x3690a4){if(_0x3690a4&&_0x3690a4['autoAssociation']===0x0){return db[_0x1de0('0x28')][_0x1de0('0x4b')]({'name':_0xa509f0['name'],'resourceId':_0xa509f0['id'],'type':_0x3690a4[_0x1de0('0x34')],'sectionId':_0x3690a4['id']},{})['then'](function(){return _0x5d14a3;});}else{return _0x5d14a3;}})[_0x1de0('0x51')](function(_0x257696){logger[_0x1de0('0x2a')](_0x1de0('0x52'),_0x257696);throw _0x257696;});}return _0x5d14a3;})[_0x1de0('0x26')](respondWithResult(_0xa9a1e5,0xc9))['catch'](handleError(_0xa9a1e5,null));};exports[_0x1de0('0x24')]=function(_0xc385ec,_0x197d8e){if(_0xc385ec[_0x1de0('0x4c')]['id']){delete _0xc385ec['body']['id'];}return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0xc385ec[_0x1de0('0x48')]['id']}})[_0x1de0('0x26')](handleEntityNotFound(_0x197d8e,null))['then'](saveUpdates(_0xc385ec[_0x1de0('0x4c')],null))[_0x1de0('0x26')](respondWithResult(_0x197d8e,null))['catch'](handleError(_0x197d8e,null));};exports[_0x1de0('0x25')]=function(_0x33ed73,_0x45f106){return db[_0x1de0('0x2e')][_0x1de0('0x4a')]({'where':{'id':_0x33ed73['params']['id']}})[_0x1de0('0x26')](handleEntityNotFound(_0x45f106,null))[_0x1de0('0x26')](removeEntity(_0x45f106,null))[_0x1de0('0x51')](handleError(_0x45f106,null));};
\ No newline at end of file