Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / api / tag / tag.controller.js
index 2135bf4..7b16f7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2a0=['name','send','map','Tag','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','user','role','UserProfileSection','autoAssociation','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','sendStatus','error','stack'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xb2a0,0xc8));var _0x0b2a=function(_0x49a40f,_0x5281e3){_0x49a40f=_0x49a40f-0x0;var _0x3adc54=_0xb2a0[_0x49a40f];return _0x3adc54;};'use strict';var pdf=require(_0x0b2a('0x0'));var emlformat=require(_0x0b2a('0x1'));var rimraf=require(_0x0b2a('0x2'));var zipdir=require(_0x0b2a('0x3'));var jsonpatch=require(_0x0b2a('0x4'));var rp=require('request-promise');var moment=require(_0x0b2a('0x5'));var BPromise=require(_0x0b2a('0x6'));var Mustache=require(_0x0b2a('0x7'));var util=require(_0x0b2a('0x8'));var path=require(_0x0b2a('0x9'));var sox=require(_0x0b2a('0xa'));var csv=require(_0x0b2a('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0b2a('0xc'));var squel=require('squel');var crypto=require(_0x0b2a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0b2a('0xb'));var querystring=require(_0x0b2a('0xe'));var Papa=require(_0x0b2a('0xf'));var Redis=require('ioredis');var authService=require(_0x0b2a('0x10'));var qs=require(_0x0b2a('0x11'));var as=require(_0x0b2a('0x12'));var hardwareService=require(_0x0b2a('0x13'));var logger=require(_0x0b2a('0x14'))(_0x0b2a('0x15'));var utils=require(_0x0b2a('0x16'));var config=require(_0x0b2a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b2a('0x18'))['db'];function respondWithStatusCode(_0x18546c,_0x2fc1d1){_0x2fc1d1=_0x2fc1d1||0xcc;return function(_0x5338d1){if(_0x5338d1){return _0x18546c['sendStatus'](_0x2fc1d1);}return _0x18546c['status'](_0x2fc1d1)[_0x0b2a('0x19')]();};}function respondWithResult(_0xcd468,_0x5f54af){_0x5f54af=_0x5f54af||0xc8;return function(_0x1d41eb){if(_0x1d41eb){return _0xcd468[_0x0b2a('0x1a')](_0x5f54af)['json'](_0x1d41eb);}};}function respondWithFilteredResult(_0x3c904b,_0x57c96e){return function(_0x1f0646){if(_0x1f0646){var _0x43e359=_0x1f0646[_0x0b2a('0x1b')],_0x3e3843=_0x57c96e[_0x0b2a('0x1c')],_0x280e87=_0x57c96e[_0x0b2a('0x1c')]+_0x57c96e['limit'],_0xba8a2d;if(_0x280e87>=_0x43e359){_0x280e87=_0x43e359;_0xba8a2d=0xc8;}else{_0xba8a2d=0xce;}_0x3c904b[_0x0b2a('0x1a')](_0xba8a2d);return _0x3c904b['set'](_0x0b2a('0x1d'),_0x3e3843+'-'+_0x280e87+'/'+_0x43e359)[_0x0b2a('0x1e')](_0x1f0646);}return null;};}function patchUpdates(_0x26c763){return function(_0x2b160d){try{jsonpatch[_0x0b2a('0x1f')](_0x2b160d,_0x26c763,!![]);}catch(_0x3f4846){return BPromise[_0x0b2a('0x20')](_0x3f4846);}return _0x2b160d[_0x0b2a('0x21')]();};}function saveUpdates(_0x2a9947,_0x492e7b){return function(_0x40c16d){if(_0x40c16d){return _0x40c16d[_0x0b2a('0x22')](_0x2a9947)[_0x0b2a('0x23')](function(_0x42a39f){return _0x42a39f;});}return null;};}function removeEntity(_0x3e4c94,_0x11be22){return function(_0x38bb89){if(_0x38bb89){return _0x38bb89[_0x0b2a('0x24')]()['then'](function(){var _0x26f065=_0x38bb89[_0x0b2a('0x25')]({'plain':!![]});var _0x24d8fd=_0x0b2a('0x26');return db[_0x0b2a('0x27')][_0x0b2a('0x24')]({'where':{'type':_0x24d8fd,'resourceId':_0x26f065['id']}})[_0x0b2a('0x23')](function(){return _0x38bb89;});})['then'](function(){_0x3e4c94[_0x0b2a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc5cd85,_0x43e02d){return function(_0x18f1c2){if(!_0x18f1c2){_0xc5cd85[_0x0b2a('0x28')](0x194);}return _0x18f1c2;};}function handleError(_0x2e0572,_0x189256){_0x189256=_0x189256||0x1f4;return function(_0x43313e){logger[_0x0b2a('0x29')](_0x43313e[_0x0b2a('0x2a')]);if(_0x43313e['name']){delete _0x43313e[_0x0b2a('0x2b')];}_0x2e0572[_0x0b2a('0x1a')](_0x189256)[_0x0b2a('0x2c')](_0x43313e);};}exports['index']=function(_0x5ae598,_0x369b0b){var _0x457afc={},_0x3c4399={},_0xa94f32={'count':0x0,'rows':[]};var _0x3f789d=_[_0x0b2a('0x2d')](db[_0x0b2a('0x2e')]['rawAttributes'],function(_0x56b074){return{'name':_0x56b074['fieldName'],'type':_0x56b074[_0x0b2a('0x2f')][_0x0b2a('0x30')]};});_0x3c4399[_0x0b2a('0x31')]=_[_0x0b2a('0x2d')](_0x3f789d,_0x0b2a('0x2b'));_0x3c4399[_0x0b2a('0x32')]=_[_0x0b2a('0x33')](_0x5ae598[_0x0b2a('0x32')]);_0x3c4399[_0x0b2a('0x34')]=_[_0x0b2a('0x35')](_0x3c4399[_0x0b2a('0x31')],_0x3c4399[_0x0b2a('0x32')]);_0x457afc[_0x0b2a('0x36')]=_[_0x0b2a('0x35')](_0x3c4399[_0x0b2a('0x31')],qs[_0x0b2a('0x37')](_0x5ae598['query']['fields']));_0x457afc[_0x0b2a('0x36')]=_0x457afc[_0x0b2a('0x36')][_0x0b2a('0x38')]?_0x457afc[_0x0b2a('0x36')]:_0x3c4399['model'];if(!_0x5ae598['query'][_0x0b2a('0x39')](_0x0b2a('0x3a'))){_0x457afc[_0x0b2a('0x3b')]=qs[_0x0b2a('0x3b')](_0x5ae598[_0x0b2a('0x32')][_0x0b2a('0x3b')]);_0x457afc[_0x0b2a('0x1c')]=qs[_0x0b2a('0x1c')](_0x5ae598['query'][_0x0b2a('0x1c')]);}_0x457afc[_0x0b2a('0x3c')]=qs[_0x0b2a('0x3d')](_0x5ae598[_0x0b2a('0x32')][_0x0b2a('0x3d')]);_0x457afc[_0x0b2a('0x3e')]=qs[_0x0b2a('0x34')](_['pick'](_0x5ae598[_0x0b2a('0x32')],_0x3c4399['filters']),_0x3f789d);if(_0x5ae598[_0x0b2a('0x32')][_0x0b2a('0x3f')]){_0x457afc[_0x0b2a('0x3e')]=_['merge'](_0x457afc['where'],{'$or':_[_0x0b2a('0x2d')](_0x3f789d,function(_0x14e8c0){if(_0x14e8c0[_0x0b2a('0x2f')]!==_0x0b2a('0x40')){var _0x54173b={};_0x54173b[_0x14e8c0[_0x0b2a('0x2b')]]={'$like':'%'+_0x5ae598[_0x0b2a('0x32')][_0x0b2a('0x3f')]+'%'};return _0x54173b;}})});}_0x457afc=_['merge']({},_0x457afc,_0x5ae598[_0x0b2a('0x41')]);var _0x257b5c={'where':_0x457afc['where']};return db[_0x0b2a('0x2e')][_0x0b2a('0x1b')](_0x257b5c)[_0x0b2a('0x23')](function(_0x4c1375){_0xa94f32[_0x0b2a('0x1b')]=_0x4c1375;if(_0x5ae598[_0x0b2a('0x32')][_0x0b2a('0x42')]){_0x457afc[_0x0b2a('0x43')]=[{'all':!![]}];}return db[_0x0b2a('0x2e')][_0x0b2a('0x44')](_0x457afc);})[_0x0b2a('0x23')](function(_0x36afdd){_0xa94f32[_0x0b2a('0x45')]=_0x36afdd;return _0xa94f32;})['then'](respondWithFilteredResult(_0x369b0b,_0x457afc))['catch'](handleError(_0x369b0b,null));};exports[_0x0b2a('0x46')]=function(_0x43a773,_0x5c5e44){var _0xaaa01d={'raw':!![],'where':{'id':_0x43a773[_0x0b2a('0x47')]['id']}},_0x1a2c7e={};_0x1a2c7e['model']=_[_0x0b2a('0x33')](db[_0x0b2a('0x2e')]['rawAttributes']);_0x1a2c7e['query']=_[_0x0b2a('0x33')](_0x43a773[_0x0b2a('0x32')]);_0x1a2c7e[_0x0b2a('0x34')]=_[_0x0b2a('0x35')](_0x1a2c7e[_0x0b2a('0x31')],_0x1a2c7e[_0x0b2a('0x32')]);_0xaaa01d[_0x0b2a('0x36')]=_[_0x0b2a('0x35')](_0x1a2c7e[_0x0b2a('0x31')],qs[_0x0b2a('0x37')](_0x43a773[_0x0b2a('0x32')][_0x0b2a('0x37')]));_0xaaa01d[_0x0b2a('0x36')]=_0xaaa01d['attributes'][_0x0b2a('0x38')]?_0xaaa01d[_0x0b2a('0x36')]:_0x1a2c7e['model'];if(_0x43a773[_0x0b2a('0x32')][_0x0b2a('0x42')]){_0xaaa01d[_0x0b2a('0x43')]=[{'all':!![]}];}_0xaaa01d=_[_0x0b2a('0x48')]({},_0xaaa01d,_0x43a773[_0x0b2a('0x41')]);return db[_0x0b2a('0x2e')][_0x0b2a('0x49')](_0xaaa01d)['then'](handleEntityNotFound(_0x5c5e44,null))[_0x0b2a('0x23')](respondWithResult(_0x5c5e44,null))[_0x0b2a('0x4a')](handleError(_0x5c5e44,null));};exports[_0x0b2a('0x4b')]=function(_0x3f57ce,_0xe66cb8){return db['Tag'][_0x0b2a('0x4b')](_0x3f57ce[_0x0b2a('0x4c')],{})['then'](function(_0x1cdd2b){var _0x156525=_0x3f57ce[_0x0b2a('0x4d')]['get']({'plain':!![]});if(!_0x156525)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x156525[_0x0b2a('0x4e')]===_0x0b2a('0x4d')){var _0x387fe7=_0x1cdd2b[_0x0b2a('0x25')]({'plain':!![]});var _0x186b44=_0x0b2a('0x26');return db[_0x0b2a('0x4f')]['find']({'where':{'name':_0x186b44,'userProfileId':_0x156525['userProfileId']},'raw':!![]})[_0x0b2a('0x23')](function(_0x5885be){if(_0x5885be&&_0x5885be[_0x0b2a('0x50')]===0x0){return db[_0x0b2a('0x27')][_0x0b2a('0x4b')]({'name':_0x387fe7['name'],'resourceId':_0x387fe7['id'],'type':_0x5885be['name'],'sectionId':_0x5885be['id']},{})[_0x0b2a('0x23')](function(){return _0x1cdd2b;});}else{return _0x1cdd2b;}})['catch'](function(_0x5b582f){logger[_0x0b2a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b582f);throw _0x5b582f;});}return _0x1cdd2b;})[_0x0b2a('0x23')](respondWithResult(_0xe66cb8,0xc9))[_0x0b2a('0x4a')](handleError(_0xe66cb8,null));};exports[_0x0b2a('0x22')]=function(_0x38f08c,_0xe44747){if(_0x38f08c['body']['id']){delete _0x38f08c[_0x0b2a('0x4c')]['id'];}return db[_0x0b2a('0x2e')]['find']({'where':{'id':_0x38f08c[_0x0b2a('0x47')]['id']}})[_0x0b2a('0x23')](handleEntityNotFound(_0xe44747,null))[_0x0b2a('0x23')](saveUpdates(_0x38f08c[_0x0b2a('0x4c')],null))[_0x0b2a('0x23')](respondWithResult(_0xe44747,null))[_0x0b2a('0x4a')](handleError(_0xe44747,null));};exports['destroy']=function(_0x4c6c49,_0x5f5b59){return db[_0x0b2a('0x2e')][_0x0b2a('0x49')]({'where':{'id':_0x4c6c49[_0x0b2a('0x47')]['id']}})[_0x0b2a('0x23')](handleEntityNotFound(_0x5f5b59,null))[_0x0b2a('0x23')](removeEntity(_0x5f5b59,null))[_0x0b2a('0x4a')](handleError(_0x5f5b59,null));};
\ No newline at end of file
+var _0xf161=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','Content-Range','apply','reject','then','get','UserProfileResource','sendStatus','error','stack','name','map','Tag','rawAttributes','fieldName','query','keys','filters','attributes','intersection','fields','length','model','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','userProfileId','autoAssociation','destroy','html-pdf','eml-format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf161,0x136));var _0x1f16=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xf161[_0xd0b415];return _0x2bdf2c;};'use strict';var pdf=require(_0x1f16('0x0'));var emlformat=require(_0x1f16('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1f16('0x2'));var jsonpatch=require(_0x1f16('0x3'));var rp=require(_0x1f16('0x4'));var moment=require(_0x1f16('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1f16('0x6'));var util=require(_0x1f16('0x7'));var path=require(_0x1f16('0x8'));var sox=require(_0x1f16('0x9'));var csv=require(_0x1f16('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1f16('0xb'));var crypto=require(_0x1f16('0xc'));var jsforce=require(_0x1f16('0xd'));var deskjs=require(_0x1f16('0xe'));var toCsv=require(_0x1f16('0xa'));var querystring=require(_0x1f16('0xf'));var Papa=require(_0x1f16('0x10'));var Redis=require(_0x1f16('0x11'));var authService=require(_0x1f16('0x12'));var qs=require(_0x1f16('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f16('0x14'));var logger=require('../../config/logger')(_0x1f16('0x15'));var utils=require(_0x1f16('0x16'));var config=require(_0x1f16('0x17'));var licenseUtil=require(_0x1f16('0x18'));var db=require(_0x1f16('0x19'))['db'];function respondWithStatusCode(_0xcb91ad,_0x46220a){_0x46220a=_0x46220a||0xcc;return function(_0x3a41dc){if(_0x3a41dc){return _0xcb91ad['sendStatus'](_0x46220a);}return _0xcb91ad[_0x1f16('0x1a')](_0x46220a)['end']();};}function respondWithResult(_0x250286,_0x4407b6){_0x4407b6=_0x4407b6||0xc8;return function(_0x1d2dfc){if(_0x1d2dfc){return _0x250286['status'](_0x4407b6)[_0x1f16('0x1b')](_0x1d2dfc);}};}function respondWithFilteredResult(_0x46301b,_0x4259b6){return function(_0xd343c0){if(_0xd343c0){var _0x251261=_0xd343c0['count'],_0x18ca7c=_0x4259b6[_0x1f16('0x1c')],_0x18710b=_0x4259b6[_0x1f16('0x1c')]+_0x4259b6[_0x1f16('0x1d')],_0x72d73b;if(_0x18710b>=_0x251261){_0x18710b=_0x251261;_0x72d73b=0xc8;}else{_0x72d73b=0xce;}_0x46301b['status'](_0x72d73b);return _0x46301b['set'](_0x1f16('0x1e'),_0x18ca7c+'-'+_0x18710b+'/'+_0x251261)[_0x1f16('0x1b')](_0xd343c0);}return null;};}function patchUpdates(_0x3f13a4){return function(_0x5b9884){try{jsonpatch[_0x1f16('0x1f')](_0x5b9884,_0x3f13a4,!![]);}catch(_0x565472){return BPromise[_0x1f16('0x20')](_0x565472);}return _0x5b9884['save']();};}function saveUpdates(_0x4d0f32,_0xfba2a2){return function(_0x502ebe){if(_0x502ebe){return _0x502ebe['update'](_0x4d0f32)[_0x1f16('0x21')](function(_0x329c3d){return _0x329c3d;});}return null;};}function removeEntity(_0x2bbc99,_0x15c40a){return function(_0x48ab0d){if(_0x48ab0d){return _0x48ab0d['destroy']()[_0x1f16('0x21')](function(){var _0x3cc402=_0x48ab0d[_0x1f16('0x22')]({'plain':!![]});var _0x27f4af='Tags';return db[_0x1f16('0x23')]['destroy']({'where':{'type':_0x27f4af,'resourceId':_0x3cc402['id']}})['then'](function(){return _0x48ab0d;});})[_0x1f16('0x21')](function(){_0x2bbc99['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c508,_0x380c2c){return function(_0x2a3708){if(!_0x2a3708){_0x30c508[_0x1f16('0x24')](0x194);}return _0x2a3708;};}function handleError(_0x3f2645,_0x50a6df){_0x50a6df=_0x50a6df||0x1f4;return function(_0x4b7463){logger[_0x1f16('0x25')](_0x4b7463[_0x1f16('0x26')]);if(_0x4b7463[_0x1f16('0x27')]){delete _0x4b7463[_0x1f16('0x27')];}_0x3f2645[_0x1f16('0x1a')](_0x50a6df)['send'](_0x4b7463);};}exports['index']=function(_0x3a2d52,_0x4f264b){var _0xebfe03={},_0x3c93fe={},_0x4e0730={'count':0x0,'rows':[]};var _0xcd4107=_[_0x1f16('0x28')](db[_0x1f16('0x29')][_0x1f16('0x2a')],function(_0x4e13f4){return{'name':_0x4e13f4[_0x1f16('0x2b')],'type':_0x4e13f4['type']['key']};});_0x3c93fe['model']=_[_0x1f16('0x28')](_0xcd4107,_0x1f16('0x27'));_0x3c93fe[_0x1f16('0x2c')]=_[_0x1f16('0x2d')](_0x3a2d52['query']);_0x3c93fe[_0x1f16('0x2e')]=_['intersection'](_0x3c93fe['model'],_0x3c93fe[_0x1f16('0x2c')]);_0xebfe03[_0x1f16('0x2f')]=_[_0x1f16('0x30')](_0x3c93fe['model'],qs[_0x1f16('0x31')](_0x3a2d52[_0x1f16('0x2c')]['fields']));_0xebfe03[_0x1f16('0x2f')]=_0xebfe03[_0x1f16('0x2f')][_0x1f16('0x32')]?_0xebfe03[_0x1f16('0x2f')]:_0x3c93fe[_0x1f16('0x33')];if(!_0x3a2d52[_0x1f16('0x2c')]['hasOwnProperty']('nolimit')){_0xebfe03[_0x1f16('0x1d')]=qs['limit'](_0x3a2d52[_0x1f16('0x2c')][_0x1f16('0x1d')]);_0xebfe03['offset']=qs[_0x1f16('0x1c')](_0x3a2d52[_0x1f16('0x2c')][_0x1f16('0x1c')]);}_0xebfe03['order']=qs[_0x1f16('0x34')](_0x3a2d52[_0x1f16('0x2c')][_0x1f16('0x34')]);_0xebfe03[_0x1f16('0x35')]=qs[_0x1f16('0x2e')](_[_0x1f16('0x36')](_0x3a2d52[_0x1f16('0x2c')],_0x3c93fe['filters']),_0xcd4107);if(_0x3a2d52[_0x1f16('0x2c')][_0x1f16('0x37')]){_0xebfe03[_0x1f16('0x35')]=_[_0x1f16('0x38')](_0xebfe03[_0x1f16('0x35')],{'$or':_[_0x1f16('0x28')](_0xcd4107,function(_0x3aa668){if(_0x3aa668[_0x1f16('0x39')]!==_0x1f16('0x3a')){var _0x494eda={};_0x494eda[_0x3aa668['name']]={'$like':'%'+_0x3a2d52[_0x1f16('0x2c')]['filter']+'%'};return _0x494eda;}})});}_0xebfe03=_[_0x1f16('0x38')]({},_0xebfe03,_0x3a2d52[_0x1f16('0x3b')]);var _0x53a1f2={'where':_0xebfe03['where']};return db['Tag'][_0x1f16('0x3c')](_0x53a1f2)['then'](function(_0x1e4a12){_0x4e0730[_0x1f16('0x3c')]=_0x1e4a12;if(_0x3a2d52[_0x1f16('0x2c')][_0x1f16('0x3d')]){_0xebfe03[_0x1f16('0x3e')]=[{'all':!![]}];}return db[_0x1f16('0x29')][_0x1f16('0x3f')](_0xebfe03);})[_0x1f16('0x21')](function(_0x94ac06){_0x4e0730[_0x1f16('0x40')]=_0x94ac06;return _0x4e0730;})[_0x1f16('0x21')](respondWithFilteredResult(_0x4f264b,_0xebfe03))[_0x1f16('0x41')](handleError(_0x4f264b,null));};exports[_0x1f16('0x42')]=function(_0x4a8df4,_0x2e9b29){var _0x578100={'raw':!![],'where':{'id':_0x4a8df4[_0x1f16('0x43')]['id']}},_0x6fff25={};_0x6fff25[_0x1f16('0x33')]=_['keys'](db[_0x1f16('0x29')][_0x1f16('0x2a')]);_0x6fff25['query']=_[_0x1f16('0x2d')](_0x4a8df4[_0x1f16('0x2c')]);_0x6fff25[_0x1f16('0x2e')]=_[_0x1f16('0x30')](_0x6fff25[_0x1f16('0x33')],_0x6fff25[_0x1f16('0x2c')]);_0x578100['attributes']=_[_0x1f16('0x30')](_0x6fff25[_0x1f16('0x33')],qs[_0x1f16('0x31')](_0x4a8df4[_0x1f16('0x2c')][_0x1f16('0x31')]));_0x578100[_0x1f16('0x2f')]=_0x578100[_0x1f16('0x2f')][_0x1f16('0x32')]?_0x578100[_0x1f16('0x2f')]:_0x6fff25['model'];if(_0x4a8df4[_0x1f16('0x2c')]['includeAll']){_0x578100[_0x1f16('0x3e')]=[{'all':!![]}];}_0x578100=_[_0x1f16('0x38')]({},_0x578100,_0x4a8df4[_0x1f16('0x3b')]);return db['Tag'][_0x1f16('0x44')](_0x578100)[_0x1f16('0x21')](handleEntityNotFound(_0x2e9b29,null))[_0x1f16('0x21')](respondWithResult(_0x2e9b29,null))[_0x1f16('0x41')](handleError(_0x2e9b29,null));};exports[_0x1f16('0x45')]=function(_0xec64f1,_0x3e009a){return db['Tag'][_0x1f16('0x45')](_0xec64f1[_0x1f16('0x46')],{})['then'](function(_0x4ec858){var _0xe28022=_0xec64f1[_0x1f16('0x47')][_0x1f16('0x22')]({'plain':!![]});if(!_0xe28022)throw new Error(_0x1f16('0x48'));if(_0xe28022[_0x1f16('0x49')]==='user'){var _0x345c5c=_0x4ec858[_0x1f16('0x22')]({'plain':!![]});var _0xe55e0d=_0x1f16('0x4a');return db['UserProfileSection'][_0x1f16('0x44')]({'where':{'name':_0xe55e0d,'userProfileId':_0xe28022[_0x1f16('0x4b')]},'raw':!![]})[_0x1f16('0x21')](function(_0x193a69){if(_0x193a69&&_0x193a69[_0x1f16('0x4c')]===0x0){return db[_0x1f16('0x23')]['create']({'name':_0x345c5c[_0x1f16('0x27')],'resourceId':_0x345c5c['id'],'type':_0x193a69['name'],'sectionId':_0x193a69['id']},{})['then'](function(){return _0x4ec858;});}else{return _0x4ec858;}})['catch'](function(_0x1187c6){logger[_0x1f16('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1187c6);throw _0x1187c6;});}return _0x4ec858;})['then'](respondWithResult(_0x3e009a,0xc9))[_0x1f16('0x41')](handleError(_0x3e009a,null));};exports['update']=function(_0x45e5fe,_0x4a97c9){if(_0x45e5fe[_0x1f16('0x46')]['id']){delete _0x45e5fe[_0x1f16('0x46')]['id'];}return db[_0x1f16('0x29')]['find']({'where':{'id':_0x45e5fe[_0x1f16('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a97c9,null))[_0x1f16('0x21')](saveUpdates(_0x45e5fe[_0x1f16('0x46')],null))[_0x1f16('0x21')](respondWithResult(_0x4a97c9,null))[_0x1f16('0x41')](handleError(_0x4a97c9,null));};exports[_0x1f16('0x4d')]=function(_0x3cc918,_0x3f2b2f){return db[_0x1f16('0x29')][_0x1f16('0x44')]({'where':{'id':_0x3cc918[_0x1f16('0x43')]['id']}})[_0x1f16('0x21')](handleEntityNotFound(_0x3f2b2f,null))[_0x1f16('0x21')](removeEntity(_0x3f2b2f,null))[_0x1f16('0x41')](handleError(_0x3f2b2f,null));};
\ No newline at end of file