Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / cmHopperAdditionalPhone / cmHopperAdditionalPhone.controller.js
index c34ff9c..c411309 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 _0x0aa8=['show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','name','send','index','CmHopperAdditionalPhone','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch'];(function(_0xed1deb,_0x147800){var _0x187a22=function(_0xdcc0dd){while(--_0xdcc0dd){_0xed1deb['push'](_0xed1deb['shift']());}};_0x187a22(++_0x147800);}(_0x0aa8,0x1a2));var _0x80aa=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x0aa8[_0x37cc52];return _0x2b4a90;};'use strict';var emlformat=require(_0x80aa('0x0'));var rimraf=require(_0x80aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80aa('0x2'));var rp=require(_0x80aa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x80aa('0x4'));var path=require(_0x80aa('0x5'));var sox=require(_0x80aa('0x6'));var csv=require(_0x80aa('0x7'));var ejs=require(_0x80aa('0x8'));var fs=require('fs');var fs_extra=require(_0x80aa('0x9'));var _=require(_0x80aa('0xa'));var squel=require(_0x80aa('0xb'));var crypto=require('crypto');var jsforce=require(_0x80aa('0xc'));var deskjs=require(_0x80aa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x80aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x80aa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x80aa('0x10'));var as=require(_0x80aa('0x11'));var hardwareService=require(_0x80aa('0x12'));var logger=require(_0x80aa('0x13'))('api');var utils=require(_0x80aa('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x80aa('0x15'))['db'];function respondWithStatusCode(_0x51e698,_0x392dd3){_0x392dd3=_0x392dd3||0xcc;return function(_0x324b27){if(_0x324b27){return _0x51e698[_0x80aa('0x16')](_0x392dd3);}return _0x51e698[_0x80aa('0x17')](_0x392dd3)[_0x80aa('0x18')]();};}function respondWithResult(_0x3f7ff3,_0xbdc68f){_0xbdc68f=_0xbdc68f||0xc8;return function(_0x37d600){if(_0x37d600){return _0x3f7ff3['status'](_0xbdc68f)[_0x80aa('0x19')](_0x37d600);}};}function respondWithFilteredResult(_0x13b622,_0x136b63){return function(_0x2c6bc5){if(_0x2c6bc5){var _0x20f93d=typeof _0x136b63[_0x80aa('0x1a')]===_0x80aa('0x1b')&&typeof _0x136b63[_0x80aa('0x1c')]===_0x80aa('0x1b');var _0x1f7753=_0x2c6bc5[_0x80aa('0x1d')];var _0x418103=_0x20f93d?0x0:_0x136b63['offset'];var _0x3b0126=_0x20f93d?_0x2c6bc5[_0x80aa('0x1d')]:_0x136b63['offset']+_0x136b63['limit'];var _0x34bfe0;if(_0x3b0126>=_0x1f7753){_0x3b0126=_0x1f7753;_0x34bfe0=0xc8;}else{_0x34bfe0=0xce;}_0x13b622[_0x80aa('0x17')](_0x34bfe0);return _0x13b622[_0x80aa('0x1e')](_0x80aa('0x1f'),_0x418103+'-'+_0x3b0126+'/'+_0x1f7753)[_0x80aa('0x19')](_0x2c6bc5);}return null;};}function patchUpdates(_0x4fa4f1){return function(_0x4c52f5){try{jsonpatch[_0x80aa('0x20')](_0x4c52f5,_0x4fa4f1,!![]);}catch(_0x909bb0){return BPromise['reject'](_0x909bb0);}return _0x4c52f5[_0x80aa('0x21')]();};}function saveUpdates(_0x17fb5b,_0x584d93){return function(_0x5756b0){if(_0x5756b0){return _0x5756b0[_0x80aa('0x22')](_0x17fb5b)[_0x80aa('0x23')](function(_0x10c419){return _0x10c419;});}return null;};}function removeEntity(_0x2df17e,_0x12ca82){return function(_0x2939d0){if(_0x2939d0){return _0x2939d0[_0x80aa('0x24')]()[_0x80aa('0x23')](function(){var _0x55aa93=_0x2939d0[_0x80aa('0x25')]({'plain':!![]});var _0x2423f2='CmHopperAdditionalPhones';return db[_0x80aa('0x26')][_0x80aa('0x24')]({'where':{'type':_0x2423f2,'resourceId':_0x55aa93['id']}})[_0x80aa('0x23')](function(){return _0x2939d0;});})[_0x80aa('0x23')](function(){_0x2df17e[_0x80aa('0x17')](0xcc)[_0x80aa('0x18')]();});}};}function handleEntityNotFound(_0x842121,_0x25df0f){return function(_0x58c5b4){if(!_0x58c5b4){_0x842121[_0x80aa('0x16')](0x194);}return _0x58c5b4;};}function handleError(_0x9801c4,_0x18c6bd){_0x18c6bd=_0x18c6bd||0x1f4;return function(_0x65e68a){logger[_0x80aa('0x27')](_0x65e68a['stack']);if(_0x65e68a[_0x80aa('0x28')]){delete _0x65e68a[_0x80aa('0x28')];}_0x9801c4[_0x80aa('0x17')](_0x18c6bd)[_0x80aa('0x29')](_0x65e68a);};}exports[_0x80aa('0x2a')]=function(_0x10d7ad,_0x432ee6){var _0x346c44={},_0x5f503c={},_0x4c78f2={'count':0x0,'rows':[]};var _0x4fe6fa=_['map'](db[_0x80aa('0x2b')][_0x80aa('0x2c')],function(_0x2e3824){return{'name':_0x2e3824[_0x80aa('0x2d')],'type':_0x2e3824[_0x80aa('0x2e')]['key']};});_0x5f503c[_0x80aa('0x2f')]=_[_0x80aa('0x30')](_0x4fe6fa,_0x80aa('0x28'));_0x5f503c[_0x80aa('0x31')]=_[_0x80aa('0x32')](_0x10d7ad[_0x80aa('0x31')]);_0x5f503c[_0x80aa('0x33')]=_[_0x80aa('0x34')](_0x5f503c['model'],_0x5f503c['query']);_0x346c44[_0x80aa('0x35')]=_[_0x80aa('0x34')](_0x5f503c[_0x80aa('0x2f')],qs['fields'](_0x10d7ad[_0x80aa('0x31')][_0x80aa('0x36')]));_0x346c44['attributes']=_0x346c44[_0x80aa('0x35')][_0x80aa('0x37')]?_0x346c44[_0x80aa('0x35')]:_0x5f503c[_0x80aa('0x2f')];if(!_0x10d7ad[_0x80aa('0x31')][_0x80aa('0x38')](_0x80aa('0x39'))){_0x346c44[_0x80aa('0x1c')]=qs['limit'](_0x10d7ad['query'][_0x80aa('0x1c')]);_0x346c44[_0x80aa('0x1a')]=qs[_0x80aa('0x1a')](_0x10d7ad[_0x80aa('0x31')]['offset']);}_0x346c44[_0x80aa('0x3a')]=qs[_0x80aa('0x3b')](_0x10d7ad[_0x80aa('0x31')][_0x80aa('0x3b')]);_0x346c44[_0x80aa('0x3c')]=qs['filters'](_['pick'](_0x10d7ad[_0x80aa('0x31')],_0x5f503c[_0x80aa('0x33')]),_0x4fe6fa);if(_0x10d7ad[_0x80aa('0x31')][_0x80aa('0x3d')]){_0x346c44[_0x80aa('0x3c')]=_['merge'](_0x346c44[_0x80aa('0x3c')],{'$or':_[_0x80aa('0x30')](_0x4fe6fa,function(_0x805688){if(_0x805688[_0x80aa('0x2e')]!=='VIRTUAL'){var _0x2c0a8d={};_0x2c0a8d[_0x805688[_0x80aa('0x28')]]={'$like':'%'+_0x10d7ad[_0x80aa('0x31')][_0x80aa('0x3d')]+'%'};return _0x2c0a8d;}})});}_0x346c44=_[_0x80aa('0x3e')]({},_0x346c44,_0x10d7ad[_0x80aa('0x3f')]);var _0x180e13={'where':_0x346c44[_0x80aa('0x3c')]};return db[_0x80aa('0x2b')][_0x80aa('0x1d')](_0x180e13)['then'](function(_0xbcbbd2){_0x4c78f2[_0x80aa('0x1d')]=_0xbcbbd2;if(_0x10d7ad[_0x80aa('0x31')][_0x80aa('0x40')]){_0x346c44[_0x80aa('0x41')]=[{'all':!![]}];}return db[_0x80aa('0x2b')]['findAll'](_0x346c44);})[_0x80aa('0x23')](function(_0x27ba11){_0x4c78f2[_0x80aa('0x42')]=_0x27ba11;return _0x4c78f2;})[_0x80aa('0x23')](respondWithFilteredResult(_0x432ee6,_0x346c44))[_0x80aa('0x43')](handleError(_0x432ee6,null));};exports[_0x80aa('0x44')]=function(_0x32ae74,_0x594648){var _0x4987d3={'raw':!![],'where':{'id':_0x32ae74[_0x80aa('0x45')]['id']}},_0x1ec6e4={};_0x1ec6e4[_0x80aa('0x2f')]=_[_0x80aa('0x32')](db[_0x80aa('0x2b')][_0x80aa('0x2c')]);_0x1ec6e4[_0x80aa('0x31')]=_[_0x80aa('0x32')](_0x32ae74['query']);_0x1ec6e4[_0x80aa('0x33')]=_[_0x80aa('0x34')](_0x1ec6e4[_0x80aa('0x2f')],_0x1ec6e4[_0x80aa('0x31')]);_0x4987d3[_0x80aa('0x35')]=_[_0x80aa('0x34')](_0x1ec6e4[_0x80aa('0x2f')],qs[_0x80aa('0x36')](_0x32ae74[_0x80aa('0x31')][_0x80aa('0x36')]));_0x4987d3[_0x80aa('0x35')]=_0x4987d3[_0x80aa('0x35')]['length']?_0x4987d3['attributes']:_0x1ec6e4['model'];if(_0x32ae74['query'][_0x80aa('0x40')]){_0x4987d3[_0x80aa('0x41')]=[{'all':!![]}];}_0x4987d3=_[_0x80aa('0x3e')]({},_0x4987d3,_0x32ae74['options']);return db[_0x80aa('0x2b')][_0x80aa('0x46')](_0x4987d3)[_0x80aa('0x23')](handleEntityNotFound(_0x594648,null))[_0x80aa('0x23')](respondWithResult(_0x594648,null))[_0x80aa('0x43')](handleError(_0x594648,null));};exports[_0x80aa('0x47')]=function(_0x2c3882,_0x3cddc8){return db[_0x80aa('0x2b')][_0x80aa('0x47')](_0x2c3882[_0x80aa('0x48')],{})['then'](function(_0x53a8fa){var _0x3ec0ff=_0x2c3882['user'][_0x80aa('0x25')]({'plain':!![]});if(!_0x3ec0ff)throw new Error(_0x80aa('0x49'));if(_0x3ec0ff[_0x80aa('0x4a')]===_0x80aa('0x4b')){var _0x2febe5=_0x53a8fa[_0x80aa('0x25')]({'plain':!![]});var _0x241962=_0x80aa('0x4c');return db[_0x80aa('0x4d')][_0x80aa('0x46')]({'where':{'name':_0x241962,'userProfileId':_0x3ec0ff[_0x80aa('0x4e')]},'raw':!![]})['then'](function(_0x2def49){if(_0x2def49&&_0x2def49[_0x80aa('0x4f')]===0x0){return db[_0x80aa('0x26')][_0x80aa('0x47')]({'name':_0x2febe5[_0x80aa('0x28')],'resourceId':_0x2febe5['id'],'type':_0x2def49[_0x80aa('0x28')],'sectionId':_0x2def49['id']},{})[_0x80aa('0x23')](function(){return _0x53a8fa;});}else{return _0x53a8fa;}})[_0x80aa('0x43')](function(_0x10843e){logger[_0x80aa('0x27')](_0x80aa('0x50'),_0x10843e);throw _0x10843e;});}return _0x53a8fa;})[_0x80aa('0x23')](respondWithResult(_0x3cddc8,0xc9))['catch'](handleError(_0x3cddc8,null));};exports[_0x80aa('0x22')]=function(_0x3bd51e,_0x340979){if(_0x3bd51e['body']['id']){delete _0x3bd51e[_0x80aa('0x48')]['id'];}return db[_0x80aa('0x2b')]['find']({'where':{'id':_0x3bd51e[_0x80aa('0x45')]['id']}})['then'](handleEntityNotFound(_0x340979,null))[_0x80aa('0x23')](saveUpdates(_0x3bd51e[_0x80aa('0x48')],null))['then'](respondWithResult(_0x340979,null))['catch'](handleError(_0x340979,null));};exports[_0x80aa('0x24')]=function(_0x3dae14,_0x3fb9aa){return db[_0x80aa('0x2b')]['find']({'where':{'id':_0x3dae14[_0x80aa('0x45')]['id']}})['then'](handleEntityNotFound(_0x3fb9aa,null))[_0x80aa('0x23')](removeEntity(_0x3fb9aa,null))[_0x80aa('0x43')](handleError(_0x3fb9aa,null));};
\ No newline at end of file