Built motion from commit c49361c37b5f784889c8087ac6e0e91b7e6b561a. Version 3.0.0...
[motion-next.git] / server / api / trigger / trigger.controller.js
index 9174523..8e61cef 100644 (file)
@@ -1 +1 @@
-const a638_0x1293=['fieldName','sequelize','filters','Triggers','UserProfileResource','autoAssociation','../../mysqldb','nolimit','../../config/logger','getAllConditions','sendStatus','Condition','../../components/parsers/qs','set','pick','attributes','include','create','rows','body','like','offset','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fields','Content-Range','status','role','error','api','catch','model','order','sort','end','where','name','index','params','includeAll','stack','TriggerId','type','intersection','map','query','keys','Trigger','getActions','show','rawAttributes','undefined','get','merge','lodash','user','then','options','Action','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','count','addAnyCondition','findOne','addAction','filter','destroy','key','length','TriggerAllId','getAnyConditions','limit'];(function(_0x859c94,_0x1293bf){const _0x20ffea=function(_0x296453){while(--_0x296453){_0x859c94['push'](_0x859c94['shift']());}};_0x20ffea(++_0x1293bf);}(a638_0x1293,0x174));const a638_0x20ff=function(_0x859c94,_0x1293bf){_0x859c94=_0x859c94-0x0;let _0x20ffea=a638_0x1293[_0x859c94];return _0x20ffea;};const _0x3e618f=a638_0x20ff;'use strict';const _=require(_0x3e618f('0x24')),qs=require(_0x3e618f('0x42')),logger=require(_0x3e618f('0x3e'))(_0x3e618f('0xb')),db=require(_0x3e618f('0x3c'))['db'],{Op}=require(_0x3e618f('0x37'));function respondWithResult(_0x296453,_0x2479b8){return _0x2479b8=_0x2479b8||0xc8,function(_0x17d90d){const _0x4f7807=a638_0x20ff;if(_0x17d90d)return _0x296453[_0x4f7807('0x8')](_0x2479b8)['json'](_0x17d90d);};}function respondWithFilteredResult(_0x3e91e0,_0x4e4f00){return function(_0x458b81){const _0x1c7717=a638_0x20ff;if(_0x458b81){const _0x563a76=_0x458b81[_0x1c7717('0x2b')],_0x5b0ee4=_0x4e4f00[_0x1c7717('0x4')];let _0x1154aa=_0x4e4f00['offset']+_0x4e4f00[_0x1c7717('0x35')],_0x40b601;return _0x1154aa>=_0x563a76?(_0x1154aa=_0x563a76,_0x40b601=0xc8):_0x40b601=0xce,_0x3e91e0[_0x1c7717('0x8')](_0x40b601),_0x3e91e0[_0x1c7717('0x43')](_0x1c7717('0x7'),_0x5b0ee4+'-'+_0x1154aa+'/'+_0x563a76)['json'](_0x458b81);}return null;};}function saveUpdates(_0x5996eb){return function(_0x2557ef){const _0x119e67=a638_0x20ff;if(_0x2557ef)return _0x2557ef['update'](_0x5996eb)[_0x119e67('0x26')](function(_0x2ff591){return _0x2ff591;});return null;};}function removeEntity(_0x9d616a){return function(_0x27f9e0){const _0x1baaa0=a638_0x20ff;if(_0x27f9e0)return _0x27f9e0['destroy']()[_0x1baaa0('0x26')](function(){const _0x540547=_0x1baaa0,_0x2dabdc=_0x27f9e0[_0x540547('0x22')]({'plain':!![]}),_0x41f903=_0x540547('0x39');return db[_0x540547('0x3a')][_0x540547('0x30')]({'where':{'type':_0x41f903,'resourceId':_0x2dabdc['id']}})[_0x540547('0x26')](function(){return _0x27f9e0;});})[_0x1baaa0('0x26')](function(){const _0x1ba919=_0x1baaa0;_0x9d616a[_0x1ba919('0x8')](0xcc)[_0x1ba919('0x10')]();});};}function handleEntityNotFound(_0x19a9af){return function(_0x2ab2c6){const _0x50d685=a638_0x20ff;return!_0x2ab2c6&&_0x19a9af[_0x50d685('0x40')](0x194),_0x2ab2c6;};}function handleError(_0x518f5d,_0x1ec9fe){return _0x1ec9fe=_0x1ec9fe||0x1f4,function(_0x59c3e2){const _0xb63fbd=a638_0x20ff;logger[_0xb63fbd('0xa')](_0x59c3e2[_0xb63fbd('0x16')]),_0x59c3e2[_0xb63fbd('0x12')]&&delete _0x59c3e2[_0xb63fbd('0x12')],_0x518f5d[_0xb63fbd('0x8')](_0x1ec9fe)['send'](_0x59c3e2);};}exports[_0x3e618f('0x13')]=function(_0x21379c,_0x475dc4){const _0x2c7f36=_0x3e618f;let _0x4b4bd4={};const _0x3c98fe={},_0x3dd872={'count':0x0,'rows':[]},_0x47792a=_[_0x2c7f36('0x1a')](db['Trigger'][_0x2c7f36('0x20')],function(_0x3ab4f4){const _0x489b64=_0x2c7f36;return{'name':_0x3ab4f4[_0x489b64('0x36')],'type':_0x3ab4f4['type'][_0x489b64('0x31')]};});_0x3c98fe[_0x2c7f36('0xd')]=_[_0x2c7f36('0x1a')](_0x47792a,_0x2c7f36('0x12')),_0x3c98fe[_0x2c7f36('0x1b')]=_[_0x2c7f36('0x1c')](_0x21379c[_0x2c7f36('0x1b')]),_0x3c98fe[_0x2c7f36('0x38')]=_[_0x2c7f36('0x19')](_0x3c98fe['model'],_0x3c98fe[_0x2c7f36('0x1b')]),_0x4b4bd4[_0x2c7f36('0x45')]=_[_0x2c7f36('0x19')](_0x3c98fe[_0x2c7f36('0xd')],qs[_0x2c7f36('0x6')](_0x21379c[_0x2c7f36('0x1b')][_0x2c7f36('0x6')])),_0x4b4bd4[_0x2c7f36('0x45')]=_0x4b4bd4[_0x2c7f36('0x45')][_0x2c7f36('0x32')]?_0x4b4bd4[_0x2c7f36('0x45')]:_0x3c98fe[_0x2c7f36('0xd')];typeof _0x21379c[_0x2c7f36('0x1b')]['nolimit']===_0x2c7f36('0x21')&&(_0x4b4bd4[_0x2c7f36('0x35')]=qs[_0x2c7f36('0x35')](_0x21379c[_0x2c7f36('0x1b')][_0x2c7f36('0x35')]),_0x4b4bd4['offset']=qs['offset'](_0x21379c[_0x2c7f36('0x1b')][_0x2c7f36('0x4')]));_0x4b4bd4[_0x2c7f36('0xe')]=qs['sort'](_0x21379c['query'][_0x2c7f36('0xf')]),_0x4b4bd4['where']=qs[_0x2c7f36('0x38')](_[_0x2c7f36('0x44')](_0x21379c['query'],_0x3c98fe[_0x2c7f36('0x38')]),_0x47792a);_0x21379c[_0x2c7f36('0x1b')][_0x2c7f36('0x2f')]&&(_0x4b4bd4['where']=_[_0x2c7f36('0x23')](_0x4b4bd4[_0x2c7f36('0x11')],{[Op['or']]:_[_0x2c7f36('0x1a')](_0x47792a,function(_0xd6607c){const _0x52335c=_0x2c7f36;if(_0xd6607c[_0x52335c('0x18')]!=='VIRTUAL'){const _0x24b4d6={};return _0x24b4d6[_0xd6607c[_0x52335c('0x12')]]={[Op['like']]:'%'+_0x21379c['query'][_0x52335c('0x2f')]+'%'},_0x24b4d6;}})}));_0x4b4bd4=_[_0x2c7f36('0x23')]({},_0x4b4bd4,_0x21379c[_0x2c7f36('0x27')]);const _0x175d9f={'where':_0x4b4bd4['where']};return db['Trigger'][_0x2c7f36('0x2b')](_0x175d9f)[_0x2c7f36('0x26')](function(_0x5a8e9f){const _0x37a7e7=_0x2c7f36;return _0x3dd872[_0x37a7e7('0x2b')]=_0x5a8e9f,_0x21379c[_0x37a7e7('0x1b')][_0x37a7e7('0x15')]&&(_0x4b4bd4[_0x37a7e7('0x46')]=[{'all':!![]}]),db[_0x37a7e7('0x1d')]['findAll'](_0x4b4bd4);})[_0x2c7f36('0x26')](function(_0x158021){const _0x820d22=_0x2c7f36;return _0x3dd872[_0x820d22('0x1')]=_0x158021,_0x3dd872;})[_0x2c7f36('0x26')](respondWithFilteredResult(_0x475dc4,_0x4b4bd4))['catch'](handleError(_0x475dc4,null));},exports[_0x3e618f('0x1f')]=function(_0x109e35,_0x484b07){const _0x52a350=_0x3e618f;let _0x58103c={'raw':![],'where':{'id':_0x109e35[_0x52a350('0x14')]['id']}};const _0x4b9f96={};return _0x4b9f96[_0x52a350('0xd')]=_[_0x52a350('0x1c')](db[_0x52a350('0x1d')][_0x52a350('0x20')]),_0x4b9f96[_0x52a350('0x1b')]=_[_0x52a350('0x1c')](_0x109e35['query']),_0x4b9f96[_0x52a350('0x38')]=_[_0x52a350('0x19')](_0x4b9f96[_0x52a350('0xd')],_0x4b9f96['query']),_0x58103c[_0x52a350('0x45')]=_[_0x52a350('0x19')](_0x4b9f96[_0x52a350('0xd')],qs[_0x52a350('0x6')](_0x109e35[_0x52a350('0x1b')][_0x52a350('0x6')])),_0x58103c[_0x52a350('0x45')]=_0x58103c[_0x52a350('0x45')][_0x52a350('0x32')]?_0x58103c[_0x52a350('0x45')]:_0x4b9f96[_0x52a350('0xd')],_0x109e35[_0x52a350('0x1b')][_0x52a350('0x15')]&&(_0x58103c[_0x52a350('0x46')]=[{'all':!![]}]),_0x58103c=_[_0x52a350('0x23')]({},_0x58103c,_0x109e35[_0x52a350('0x27')]),db[_0x52a350('0x1d')][_0x52a350('0x2d')](_0x58103c)[_0x52a350('0x26')](handleEntityNotFound(_0x484b07,null))['then'](respondWithResult(_0x484b07,null))[_0x52a350('0xc')](handleError(_0x484b07,null));},exports['create']=function(_0x22cfb7,_0x131c4a){const _0x152363=_0x3e618f;return db[_0x152363('0x1d')]['create'](_0x22cfb7[_0x152363('0x2')],{})['then'](function(_0x422732){const _0x18a6d3=_0x152363,_0x464d50=_0x22cfb7['user'][_0x18a6d3('0x22')]({'plain':!![]});if(!_0x464d50)throw new Error(_0x18a6d3('0x29'));if(_0x464d50[_0x18a6d3('0x9')]===_0x18a6d3('0x25')){const _0x238118=_0x422732[_0x18a6d3('0x22')]({'plain':!![]}),_0x2153be=_0x18a6d3('0x39');return db[_0x18a6d3('0x2a')][_0x18a6d3('0x2d')]({'where':{'name':_0x2153be,'userProfileId':_0x464d50['userProfileId']},'raw':!![]})[_0x18a6d3('0x26')](function(_0x298e1d){const _0x47fe4e=_0x18a6d3;return _0x298e1d&&_0x298e1d[_0x47fe4e('0x3b')]===0x0?db[_0x47fe4e('0x3a')]['create']({'name':_0x238118[_0x47fe4e('0x12')],'resourceId':_0x238118['id'],'type':_0x298e1d['name'],'sectionId':_0x298e1d['id']},{})[_0x47fe4e('0x26')](function(){return _0x422732;}):_0x422732;})[_0x18a6d3('0xc')](function(_0x94191c){const _0x96e2ef=_0x18a6d3;logger['error'](_0x96e2ef('0x5'),_0x94191c);throw _0x94191c;});}return _0x422732;})[_0x152363('0x26')](respondWithResult(_0x131c4a,0xc9))[_0x152363('0xc')](handleError(_0x131c4a,null));},exports['update']=function(_0x5e7e8d,_0x3df16d){const _0x31b118=_0x3e618f;return _0x5e7e8d['body']['id']&&delete _0x5e7e8d[_0x31b118('0x2')]['id'],db['Trigger'][_0x31b118('0x2d')]({'where':{'id':_0x5e7e8d[_0x31b118('0x14')]['id']}})[_0x31b118('0x26')](handleEntityNotFound(_0x3df16d,null))['then'](saveUpdates(_0x5e7e8d[_0x31b118('0x2')],null))[_0x31b118('0x26')](respondWithResult(_0x3df16d,null))[_0x31b118('0xc')](handleError(_0x3df16d,null));},exports[_0x3e618f('0x30')]=function(_0x227298,_0xa7a07e){const _0x46f343=_0x3e618f;return db[_0x46f343('0x1d')][_0x46f343('0x2d')]({'where':{'id':_0x227298['params']['id']}})[_0x46f343('0x26')](handleEntityNotFound(_0xa7a07e,null))['then'](removeEntity(_0xa7a07e,null))[_0x46f343('0xc')](handleError(_0xa7a07e,null));},exports['addAllCondition']=function(_0x3cca8b,_0x26b2f6){const _0x3bb173=_0x3e618f;return _0x3cca8b['body']['id']&&delete _0x3cca8b['body']['id'],db[_0x3bb173('0x1d')][_0x3bb173('0x2d')]({'where':{'id':_0x3cca8b['params']['id']}})[_0x3bb173('0x26')](handleEntityNotFound(_0x26b2f6,null))['then'](function(_0x17ac36){const _0x3e607b=_0x3bb173;if(_0x17ac36)return _0x3cca8b[_0x3e607b('0x2')][_0x3e607b('0x33')]=_0x17ac36['id'],db['Condition']['create'](_0x3cca8b[_0x3e607b('0x2')]);})[_0x3bb173('0x26')](respondWithResult(_0x26b2f6,null))[_0x3bb173('0xc')](handleError(_0x26b2f6,null));},exports[_0x3e618f('0x2c')]=function(_0x520928,_0x40573b){const _0x5a99d8=_0x3e618f;return _0x520928[_0x5a99d8('0x2')]['id']&&delete _0x520928[_0x5a99d8('0x2')]['id'],db['Trigger'][_0x5a99d8('0x2d')]({'where':{'id':_0x520928[_0x5a99d8('0x14')]['id']}})[_0x5a99d8('0x26')](handleEntityNotFound(_0x40573b,null))[_0x5a99d8('0x26')](function(_0xc85aa8){const _0x5a012f=_0x5a99d8;if(_0xc85aa8)return _0x520928[_0x5a012f('0x2')]['TriggerAnyId']=_0xc85aa8['id'],db[_0x5a012f('0x41')][_0x5a012f('0x0')](_0x520928[_0x5a012f('0x2')]);})[_0x5a99d8('0x26')](respondWithResult(_0x40573b,null))['catch'](handleError(_0x40573b,null));},exports[_0x3e618f('0x3f')]=function(_0x3d7aea,_0x1ada97){const _0x3d3e52=_0x3e618f;let _0x4bd469={};const _0x4fc36e={};let _0x29843e,_0x44ad17;return db[_0x3d3e52('0x1d')][_0x3d3e52('0x2d')]({'where':{'id':_0x3d7aea[_0x3d3e52('0x14')]['id']}})['then'](handleEntityNotFound(_0x1ada97,null))['then'](function(_0x1bb9c7){const _0x28b268=_0x3d3e52;if(_0x1bb9c7)return _0x29843e=_0x1bb9c7,_0x4fc36e['model']=_[_0x28b268('0x1c')](db[_0x28b268('0x41')][_0x28b268('0x20')]),_0x4fc36e[_0x28b268('0x1b')]=_[_0x28b268('0x1c')](_0x3d7aea[_0x28b268('0x1b')]),_0x4fc36e[_0x28b268('0x38')]=_[_0x28b268('0x19')](_0x4fc36e['model'],_0x4fc36e[_0x28b268('0x1b')]),_0x4bd469[_0x28b268('0x45')]=_[_0x28b268('0x19')](_0x4fc36e[_0x28b268('0xd')],qs[_0x28b268('0x6')](_0x3d7aea[_0x28b268('0x1b')][_0x28b268('0x6')])),_0x4bd469[_0x28b268('0x45')]=_0x4bd469[_0x28b268('0x45')][_0x28b268('0x32')]?_0x4bd469['attributes']:_0x4fc36e[_0x28b268('0xd')],_0x4bd469[_0x28b268('0xe')]=qs[_0x28b268('0xf')](_0x3d7aea[_0x28b268('0x1b')]['sort']),_0x4bd469[_0x28b268('0x11')]=qs['filters'](_[_0x28b268('0x44')](_0x3d7aea[_0x28b268('0x1b')],_0x4fc36e['filters'])),_0x3d7aea[_0x28b268('0x1b')][_0x28b268('0x2f')]&&(_0x4bd469[_0x28b268('0x11')]=_[_0x28b268('0x23')](_0x4bd469['where'],{[Op['or']]:_['map'](_0x4bd469['attributes'],function(_0x275159){const _0x4e612f=_0x28b268,_0x1d5a6a={};return _0x1d5a6a[_0x275159]={[Op[_0x4e612f('0x3')]]:'%'+_0x3d7aea[_0x4e612f('0x1b')][_0x4e612f('0x2f')]+'%'},_0x1d5a6a;})})),_0x4bd469=_[_0x28b268('0x23')]({},_0x4bd469,_0x3d7aea[_0x28b268('0x27')]),_0x29843e['getAllConditions'](_0x4bd469);})['then'](function(_0x275427){const _0x3326c3=_0x3d3e52;if(_0x275427)return _0x44ad17=_0x275427[_0x3326c3('0x32')],typeof _0x3d7aea[_0x3326c3('0x1b')]['nolimit']===_0x3326c3('0x21')&&(_0x4bd469[_0x3326c3('0x35')]=qs[_0x3326c3('0x35')](_0x3d7aea['query']['limit']),_0x4bd469[_0x3326c3('0x4')]=qs['offset'](_0x3d7aea[_0x3326c3('0x1b')][_0x3326c3('0x4')])),_0x29843e[_0x3326c3('0x3f')](_0x4bd469);})[_0x3d3e52('0x26')](function(_0xbb2022){if(_0xbb2022)return _0xbb2022?{'count':_0x44ad17,'rows':_0xbb2022}:null;})['then'](respondWithResult(_0x1ada97,null))[_0x3d3e52('0xc')](handleError(_0x1ada97,null));},exports['getAnyConditions']=function(_0x2271fe,_0x48f1e8){const _0x39a63c=_0x3e618f;let _0x3947e1={};const _0x15e229={};let _0x4bf468,_0x21d12a;return db['Trigger'][_0x39a63c('0x2d')]({'where':{'id':_0x2271fe[_0x39a63c('0x14')]['id']}})[_0x39a63c('0x26')](handleEntityNotFound(_0x48f1e8,null))['then'](function(_0x53c712){const _0x229244=_0x39a63c;if(_0x53c712)return _0x4bf468=_0x53c712,_0x15e229[_0x229244('0xd')]=_[_0x229244('0x1c')](db[_0x229244('0x41')]['rawAttributes']),_0x15e229[_0x229244('0x1b')]=_[_0x229244('0x1c')](_0x2271fe['query']),_0x15e229[_0x229244('0x38')]=_[_0x229244('0x19')](_0x15e229[_0x229244('0xd')],_0x15e229['query']),_0x3947e1['attributes']=_[_0x229244('0x19')](_0x15e229['model'],qs['fields'](_0x2271fe[_0x229244('0x1b')][_0x229244('0x6')])),_0x3947e1['attributes']=_0x3947e1[_0x229244('0x45')][_0x229244('0x32')]?_0x3947e1['attributes']:_0x15e229[_0x229244('0xd')],_0x3947e1[_0x229244('0xe')]=qs['sort'](_0x2271fe[_0x229244('0x1b')][_0x229244('0xf')]),_0x3947e1['where']=qs[_0x229244('0x38')](_[_0x229244('0x44')](_0x2271fe[_0x229244('0x1b')],_0x15e229[_0x229244('0x38')])),_0x2271fe['query'][_0x229244('0x2f')]&&(_0x3947e1[_0x229244('0x11')]=_['merge'](_0x3947e1[_0x229244('0x11')],{[Op['or']]:_[_0x229244('0x1a')](_0x3947e1[_0x229244('0x45')],function(_0x4b70f3){const _0x49ceaa=_0x229244,_0x50ec2d={};return _0x50ec2d[_0x4b70f3]={[Op[_0x49ceaa('0x3')]]:'%'+_0x2271fe[_0x49ceaa('0x1b')][_0x49ceaa('0x2f')]+'%'},_0x50ec2d;})})),_0x3947e1=_[_0x229244('0x23')]({},_0x3947e1,_0x2271fe[_0x229244('0x27')]),_0x4bf468[_0x229244('0x34')](_0x3947e1);})[_0x39a63c('0x26')](function(_0x233433){const _0x5c5680=_0x39a63c;if(_0x233433)return _0x21d12a=_0x233433[_0x5c5680('0x32')],typeof _0x2271fe['query'][_0x5c5680('0x3d')]===_0x5c5680('0x21')&&(_0x3947e1['limit']=qs[_0x5c5680('0x35')](_0x2271fe[_0x5c5680('0x1b')][_0x5c5680('0x35')]),_0x3947e1[_0x5c5680('0x4')]=qs['offset'](_0x2271fe[_0x5c5680('0x1b')][_0x5c5680('0x4')])),_0x4bf468[_0x5c5680('0x34')](_0x3947e1);})[_0x39a63c('0x26')](function(_0x2a3b6f){if(_0x2a3b6f)return _0x2a3b6f?{'count':_0x21d12a,'rows':_0x2a3b6f}:null;})['then'](respondWithResult(_0x48f1e8,null))[_0x39a63c('0xc')](handleError(_0x48f1e8,null));},exports[_0x3e618f('0x2e')]=function(_0x14b32a,_0x49e6ca){const _0x21cdc9=_0x3e618f;return _0x14b32a[_0x21cdc9('0x2')]['id']&&delete _0x14b32a[_0x21cdc9('0x2')]['id'],db[_0x21cdc9('0x1d')][_0x21cdc9('0x2d')]({'where':{'id':_0x14b32a[_0x21cdc9('0x14')]['id']}})['then'](handleEntityNotFound(_0x49e6ca,null))[_0x21cdc9('0x26')](function(_0x32e024){const _0x145999=_0x21cdc9;if(_0x32e024)return _0x14b32a[_0x145999('0x2')][_0x145999('0x17')]=_0x32e024['id'],db[_0x145999('0x28')][_0x145999('0x0')](_0x14b32a[_0x145999('0x2')]);})['then'](respondWithResult(_0x49e6ca,null))[_0x21cdc9('0xc')](handleError(_0x49e6ca,null));},exports[_0x3e618f('0x1e')]=function(_0x46ef74,_0x34c238){const _0x3f8ba7=_0x3e618f;let _0x5d4665={};const _0x1133d8={};let _0x589ef7,_0x369613;return db[_0x3f8ba7('0x1d')]['findOne']({'where':{'id':_0x46ef74['params']['id']}})[_0x3f8ba7('0x26')](handleEntityNotFound(_0x34c238,null))[_0x3f8ba7('0x26')](function(_0x35e786){const _0x8059fd=_0x3f8ba7;if(_0x35e786)return _0x589ef7=_0x35e786,_0x1133d8[_0x8059fd('0xd')]=_[_0x8059fd('0x1c')](db[_0x8059fd('0x28')][_0x8059fd('0x20')]),_0x1133d8[_0x8059fd('0x1b')]=_['keys'](_0x46ef74[_0x8059fd('0x1b')]),_0x1133d8[_0x8059fd('0x38')]=_[_0x8059fd('0x19')](_0x1133d8[_0x8059fd('0xd')],_0x1133d8[_0x8059fd('0x1b')]),_0x5d4665[_0x8059fd('0x45')]=_[_0x8059fd('0x19')](_0x1133d8['model'],qs[_0x8059fd('0x6')](_0x46ef74[_0x8059fd('0x1b')][_0x8059fd('0x6')])),_0x5d4665[_0x8059fd('0x45')]=_0x5d4665[_0x8059fd('0x45')][_0x8059fd('0x32')]?_0x5d4665[_0x8059fd('0x45')]:_0x1133d8['model'],_0x5d4665[_0x8059fd('0xe')]=qs[_0x8059fd('0xf')](_0x46ef74['query'][_0x8059fd('0xf')]),_0x5d4665[_0x8059fd('0x11')]=qs[_0x8059fd('0x38')](_[_0x8059fd('0x44')](_0x46ef74[_0x8059fd('0x1b')],_0x1133d8[_0x8059fd('0x38')])),_0x46ef74[_0x8059fd('0x1b')][_0x8059fd('0x2f')]&&(_0x5d4665[_0x8059fd('0x11')]=_[_0x8059fd('0x23')](_0x5d4665['where'],{[Op['or']]:_[_0x8059fd('0x1a')](_0x5d4665[_0x8059fd('0x45')],function(_0x1ac2bf){const _0x28a6e4=_0x8059fd,_0x3fe107={};return _0x3fe107[_0x1ac2bf]={[Op[_0x28a6e4('0x3')]]:'%'+_0x46ef74['query'][_0x28a6e4('0x2f')]+'%'},_0x3fe107;})})),_0x5d4665=_[_0x8059fd('0x23')]({},_0x5d4665,_0x46ef74[_0x8059fd('0x27')]),_0x589ef7[_0x8059fd('0x1e')](_0x5d4665);})[_0x3f8ba7('0x26')](function(_0x3a3300){const _0x12b74f=_0x3f8ba7;if(_0x3a3300)return _0x369613=_0x3a3300[_0x12b74f('0x32')],typeof _0x46ef74['query'][_0x12b74f('0x3d')]==='undefined'&&(_0x5d4665[_0x12b74f('0x35')]=qs[_0x12b74f('0x35')](_0x46ef74['query']['limit']),_0x5d4665[_0x12b74f('0x4')]=qs[_0x12b74f('0x4')](_0x46ef74[_0x12b74f('0x1b')][_0x12b74f('0x4')])),_0x589ef7['getActions'](_0x5d4665);})[_0x3f8ba7('0x26')](function(_0x5a62b4){if(_0x5a62b4)return _0x5a62b4?{'count':_0x369613,'rows':_0x5a62b4}:null;})[_0x3f8ba7('0x26')](respondWithResult(_0x34c238,null))[_0x3f8ba7('0xc')](handleError(_0x34c238,null));};
\ No newline at end of file
+const a638_0x409b=['../../mysqldb','pick','query','stack','UserProfileResource','UserProfileSection','VIRTUAL','set','json','catch','user','type','update','includeAll','api','userProfileId','attributes','undefined','name','model','Trigger','autoAssociation','then','length','create','rawAttributes','count','Triggers','limit','getAnyConditions','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getActions','index','Unable\x20to\x20retrieve\x20the\x20current\x20user','sequelize','destroy','offset','include','filter','show','get','role','getAllConditions','filters','TriggerId','intersection','Content-Range','addAllCondition','fields','merge','status','addAction','order','params','fieldName','map','body','sendStatus','error','send','findOne','nolimit','lodash','TriggerAnyId','key','end','like','options','keys','Condition','Action','where','sort'];(function(_0x54b0c4,_0x409b83){const _0x201254=function(_0x530acd){while(--_0x530acd){_0x54b0c4['push'](_0x54b0c4['shift']());}};_0x201254(++_0x409b83);}(a638_0x409b,0x1a9));const a638_0x2012=function(_0x54b0c4,_0x409b83){_0x54b0c4=_0x54b0c4-0x0;let _0x201254=a638_0x409b[_0x54b0c4];return _0x201254;};const _0x23b718=a638_0x2012;'use strict';const _=require(_0x23b718('0x2')),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')(_0x23b718('0x1b')),db=require(_0x23b718('0xd'))['db'],{Op}=require(_0x23b718('0x2f'));function respondWithResult(_0x530acd,_0x31ff76){return _0x31ff76=_0x31ff76||0xc8,function(_0x1cfa64){const _0x20c6a6=a638_0x2012;if(_0x1cfa64)return _0x530acd[_0x20c6a6('0x3f')](_0x31ff76)[_0x20c6a6('0x15')](_0x1cfa64);};}function respondWithFilteredResult(_0xb1216d,_0x4a3c15){return function(_0x49df0a){const _0x4d095b=a638_0x2012;if(_0x49df0a){const _0x52173e=_0x49df0a[_0x4d095b('0x27')],_0x532898=_0x4a3c15[_0x4d095b('0x31')];let _0x2fa0fb=_0x4a3c15[_0x4d095b('0x31')]+_0x4a3c15['limit'],_0x4d51c0;return _0x2fa0fb>=_0x52173e?(_0x2fa0fb=_0x52173e,_0x4d51c0=0xc8):_0x4d51c0=0xce,_0xb1216d[_0x4d095b('0x3f')](_0x4d51c0),_0xb1216d[_0x4d095b('0x14')](_0x4d095b('0x3b'),_0x532898+'-'+_0x2fa0fb+'/'+_0x52173e)[_0x4d095b('0x15')](_0x49df0a);}return null;};}function saveUpdates(_0x557e7f){return function(_0x221e25){const _0xe5f305=a638_0x2012;if(_0x221e25)return _0x221e25[_0xe5f305('0x19')](_0x557e7f)[_0xe5f305('0x23')](function(_0x3ea869){return _0x3ea869;});return null;};}function removeEntity(_0x101d08){return function(_0x48116f){const _0x5339c8=a638_0x2012;if(_0x48116f)return _0x48116f[_0x5339c8('0x30')]()[_0x5339c8('0x23')](function(){const _0x59fc0a=_0x5339c8,_0x48d835=_0x48116f[_0x59fc0a('0x35')]({'plain':!![]}),_0x6fec3c='Triggers';return db[_0x59fc0a('0x11')][_0x59fc0a('0x30')]({'where':{'type':_0x6fec3c,'resourceId':_0x48d835['id']}})[_0x59fc0a('0x23')](function(){return _0x48116f;});})[_0x5339c8('0x23')](function(){const _0x5ed06b=_0x5339c8;_0x101d08[_0x5ed06b('0x3f')](0xcc)[_0x5ed06b('0x5')]();});};}function handleEntityNotFound(_0x3cc39b){return function(_0x5e994b){const _0x23babc=a638_0x2012;return!_0x5e994b&&_0x3cc39b[_0x23babc('0x46')](0x194),_0x5e994b;};}function handleError(_0xb2d274,_0x5a9f2f){return _0x5a9f2f=_0x5a9f2f||0x1f4,function(_0x1dd650){const _0xa41c23=a638_0x2012;logger[_0xa41c23('0x47')](_0x1dd650[_0xa41c23('0x10')]),_0x1dd650[_0xa41c23('0x1f')]&&delete _0x1dd650[_0xa41c23('0x1f')],_0xb2d274[_0xa41c23('0x3f')](_0x5a9f2f)[_0xa41c23('0x48')](_0x1dd650);};}exports[_0x23b718('0x2d')]=function(_0x45911b,_0x1a2914){const _0x3929a7=_0x23b718;let _0x2c4846={};const _0x567a60={},_0x500e02={'count':0x0,'rows':[]},_0x205248=_['map'](db['Trigger'][_0x3929a7('0x26')],function(_0x24f3a8){const _0x4cde34=_0x3929a7;return{'name':_0x24f3a8[_0x4cde34('0x43')],'type':_0x24f3a8[_0x4cde34('0x18')][_0x4cde34('0x4')]};});_0x567a60[_0x3929a7('0x20')]=_['map'](_0x205248,_0x3929a7('0x1f')),_0x567a60[_0x3929a7('0xf')]=_[_0x3929a7('0x8')](_0x45911b[_0x3929a7('0xf')]),_0x567a60[_0x3929a7('0x38')]=_[_0x3929a7('0x3a')](_0x567a60[_0x3929a7('0x20')],_0x567a60[_0x3929a7('0xf')]),_0x2c4846[_0x3929a7('0x1d')]=_[_0x3929a7('0x3a')](_0x567a60['model'],qs['fields'](_0x45911b[_0x3929a7('0xf')]['fields'])),_0x2c4846[_0x3929a7('0x1d')]=_0x2c4846[_0x3929a7('0x1d')][_0x3929a7('0x24')]?_0x2c4846[_0x3929a7('0x1d')]:_0x567a60[_0x3929a7('0x20')];typeof _0x45911b[_0x3929a7('0xf')][_0x3929a7('0x1')]===_0x3929a7('0x1e')&&(_0x2c4846[_0x3929a7('0x29')]=qs[_0x3929a7('0x29')](_0x45911b[_0x3929a7('0xf')][_0x3929a7('0x29')]),_0x2c4846['offset']=qs[_0x3929a7('0x31')](_0x45911b[_0x3929a7('0xf')][_0x3929a7('0x31')]));_0x2c4846[_0x3929a7('0x41')]=qs['sort'](_0x45911b[_0x3929a7('0xf')][_0x3929a7('0xc')]),_0x2c4846['where']=qs[_0x3929a7('0x38')](_['pick'](_0x45911b[_0x3929a7('0xf')],_0x567a60[_0x3929a7('0x38')]),_0x205248);_0x45911b[_0x3929a7('0xf')]['filter']&&(_0x2c4846[_0x3929a7('0xb')]=_[_0x3929a7('0x3e')](_0x2c4846['where'],{[Op['or']]:_['map'](_0x205248,function(_0x505bd6){const _0x78ea90=_0x3929a7;if(_0x505bd6[_0x78ea90('0x18')]!==_0x78ea90('0x13')){const _0x2e42ea={};return _0x2e42ea[_0x505bd6[_0x78ea90('0x1f')]]={[Op['like']]:'%'+_0x45911b[_0x78ea90('0xf')][_0x78ea90('0x33')]+'%'},_0x2e42ea;}})}));_0x2c4846=_[_0x3929a7('0x3e')]({},_0x2c4846,_0x45911b[_0x3929a7('0x7')]);const _0x1d4b72={'where':_0x2c4846[_0x3929a7('0xb')]};return db[_0x3929a7('0x21')][_0x3929a7('0x27')](_0x1d4b72)[_0x3929a7('0x23')](function(_0x3e267c){const _0x4bb128=_0x3929a7;return _0x500e02[_0x4bb128('0x27')]=_0x3e267c,_0x45911b[_0x4bb128('0xf')]['includeAll']&&(_0x2c4846[_0x4bb128('0x32')]=[{'all':!![]}]),db['Trigger']['findAll'](_0x2c4846);})[_0x3929a7('0x23')](function(_0xf1e3d){return _0x500e02['rows']=_0xf1e3d,_0x500e02;})[_0x3929a7('0x23')](respondWithFilteredResult(_0x1a2914,_0x2c4846))['catch'](handleError(_0x1a2914,null));},exports[_0x23b718('0x34')]=function(_0x4ff39e,_0x147947){const _0xd3b51d=_0x23b718;let _0x24fcef={'raw':![],'where':{'id':_0x4ff39e[_0xd3b51d('0x42')]['id']}};const _0x340479={};return _0x340479[_0xd3b51d('0x20')]=_[_0xd3b51d('0x8')](db[_0xd3b51d('0x21')][_0xd3b51d('0x26')]),_0x340479['query']=_[_0xd3b51d('0x8')](_0x4ff39e['query']),_0x340479[_0xd3b51d('0x38')]=_[_0xd3b51d('0x3a')](_0x340479[_0xd3b51d('0x20')],_0x340479[_0xd3b51d('0xf')]),_0x24fcef['attributes']=_['intersection'](_0x340479[_0xd3b51d('0x20')],qs[_0xd3b51d('0x3d')](_0x4ff39e[_0xd3b51d('0xf')]['fields'])),_0x24fcef[_0xd3b51d('0x1d')]=_0x24fcef[_0xd3b51d('0x1d')][_0xd3b51d('0x24')]?_0x24fcef['attributes']:_0x340479['model'],_0x4ff39e[_0xd3b51d('0xf')][_0xd3b51d('0x1a')]&&(_0x24fcef[_0xd3b51d('0x32')]=[{'all':!![]}]),_0x24fcef=_['merge']({},_0x24fcef,_0x4ff39e['options']),db[_0xd3b51d('0x21')][_0xd3b51d('0x0')](_0x24fcef)[_0xd3b51d('0x23')](handleEntityNotFound(_0x147947,null))[_0xd3b51d('0x23')](respondWithResult(_0x147947,null))[_0xd3b51d('0x16')](handleError(_0x147947,null));},exports[_0x23b718('0x25')]=function(_0x21bebd,_0x4f5354){const _0x45d828=_0x23b718;return db[_0x45d828('0x21')][_0x45d828('0x25')](_0x21bebd[_0x45d828('0x45')],{})[_0x45d828('0x23')](function(_0x38e271){const _0x4c0317=_0x45d828,_0x2dafe5=_0x21bebd[_0x4c0317('0x17')][_0x4c0317('0x35')]({'plain':!![]});if(!_0x2dafe5)throw new Error(_0x4c0317('0x2e'));if(_0x2dafe5[_0x4c0317('0x36')]===_0x4c0317('0x17')){const _0x154c68=_0x38e271['get']({'plain':!![]}),_0x5134c=_0x4c0317('0x28');return db[_0x4c0317('0x12')][_0x4c0317('0x0')]({'where':{'name':_0x5134c,'userProfileId':_0x2dafe5[_0x4c0317('0x1c')]},'raw':!![]})[_0x4c0317('0x23')](function(_0x471e2c){const _0x317c42=_0x4c0317;return _0x471e2c&&_0x471e2c[_0x317c42('0x22')]===0x0?db[_0x317c42('0x11')][_0x317c42('0x25')]({'name':_0x154c68[_0x317c42('0x1f')],'resourceId':_0x154c68['id'],'type':_0x471e2c[_0x317c42('0x1f')],'sectionId':_0x471e2c['id']},{})[_0x317c42('0x23')](function(){return _0x38e271;}):_0x38e271;})[_0x4c0317('0x16')](function(_0x58e952){const _0x2c5dc7=_0x4c0317;logger[_0x2c5dc7('0x47')](_0x2c5dc7('0x2b'),_0x58e952);throw _0x58e952;});}return _0x38e271;})[_0x45d828('0x23')](respondWithResult(_0x4f5354,0xc9))[_0x45d828('0x16')](handleError(_0x4f5354,null));},exports['update']=function(_0x29dc14,_0x43573c){const _0x422384=_0x23b718;return _0x29dc14[_0x422384('0x45')]['id']&&delete _0x29dc14['body']['id'],db[_0x422384('0x21')][_0x422384('0x0')]({'where':{'id':_0x29dc14[_0x422384('0x42')]['id']}})[_0x422384('0x23')](handleEntityNotFound(_0x43573c,null))[_0x422384('0x23')](saveUpdates(_0x29dc14[_0x422384('0x45')],null))['then'](respondWithResult(_0x43573c,null))[_0x422384('0x16')](handleError(_0x43573c,null));},exports['destroy']=function(_0x37a9ef,_0x4d2a50){const _0x4b5954=_0x23b718;return db['Trigger'][_0x4b5954('0x0')]({'where':{'id':_0x37a9ef[_0x4b5954('0x42')]['id']}})[_0x4b5954('0x23')](handleEntityNotFound(_0x4d2a50,null))[_0x4b5954('0x23')](removeEntity(_0x4d2a50,null))['catch'](handleError(_0x4d2a50,null));},exports[_0x23b718('0x3c')]=function(_0x521be7,_0x27f00b){const _0x5b7a6d=_0x23b718;return _0x521be7['body']['id']&&delete _0x521be7[_0x5b7a6d('0x45')]['id'],db[_0x5b7a6d('0x21')][_0x5b7a6d('0x0')]({'where':{'id':_0x521be7[_0x5b7a6d('0x42')]['id']}})[_0x5b7a6d('0x23')](handleEntityNotFound(_0x27f00b,null))[_0x5b7a6d('0x23')](function(_0x4280d0){const _0x219a52=_0x5b7a6d;if(_0x4280d0)return _0x521be7[_0x219a52('0x45')]['TriggerAllId']=_0x4280d0['id'],db[_0x219a52('0x9')]['create'](_0x521be7[_0x219a52('0x45')]);})['then'](respondWithResult(_0x27f00b,null))[_0x5b7a6d('0x16')](handleError(_0x27f00b,null));},exports['addAnyCondition']=function(_0x4fe0a0,_0x3eb043){const _0x479f63=_0x23b718;return _0x4fe0a0[_0x479f63('0x45')]['id']&&delete _0x4fe0a0[_0x479f63('0x45')]['id'],db['Trigger'][_0x479f63('0x0')]({'where':{'id':_0x4fe0a0[_0x479f63('0x42')]['id']}})[_0x479f63('0x23')](handleEntityNotFound(_0x3eb043,null))[_0x479f63('0x23')](function(_0x4a3eb8){const _0x4fe002=_0x479f63;if(_0x4a3eb8)return _0x4fe0a0[_0x4fe002('0x45')][_0x4fe002('0x3')]=_0x4a3eb8['id'],db[_0x4fe002('0x9')][_0x4fe002('0x25')](_0x4fe0a0[_0x4fe002('0x45')]);})[_0x479f63('0x23')](respondWithResult(_0x3eb043,null))['catch'](handleError(_0x3eb043,null));},exports[_0x23b718('0x37')]=function(_0x5f2fdf,_0x4f8923){const _0x30240c=_0x23b718;let _0x30a13b={};const _0x501404={};let _0x441f67,_0x4f5828;return db[_0x30240c('0x21')][_0x30240c('0x0')]({'where':{'id':_0x5f2fdf[_0x30240c('0x42')]['id']}})[_0x30240c('0x23')](handleEntityNotFound(_0x4f8923,null))[_0x30240c('0x23')](function(_0x330390){const _0x16958f=_0x30240c;if(_0x330390)return _0x441f67=_0x330390,_0x501404[_0x16958f('0x20')]=_[_0x16958f('0x8')](db[_0x16958f('0x9')]['rawAttributes']),_0x501404['query']=_[_0x16958f('0x8')](_0x5f2fdf[_0x16958f('0xf')]),_0x501404[_0x16958f('0x38')]=_[_0x16958f('0x3a')](_0x501404['model'],_0x501404[_0x16958f('0xf')]),_0x30a13b['attributes']=_[_0x16958f('0x3a')](_0x501404[_0x16958f('0x20')],qs[_0x16958f('0x3d')](_0x5f2fdf[_0x16958f('0xf')]['fields'])),_0x30a13b[_0x16958f('0x1d')]=_0x30a13b['attributes'][_0x16958f('0x24')]?_0x30a13b[_0x16958f('0x1d')]:_0x501404['model'],_0x30a13b['order']=qs[_0x16958f('0xc')](_0x5f2fdf[_0x16958f('0xf')][_0x16958f('0xc')]),_0x30a13b['where']=qs[_0x16958f('0x38')](_['pick'](_0x5f2fdf[_0x16958f('0xf')],_0x501404[_0x16958f('0x38')])),_0x5f2fdf['query'][_0x16958f('0x33')]&&(_0x30a13b[_0x16958f('0xb')]=_[_0x16958f('0x3e')](_0x30a13b['where'],{[Op['or']]:_['map'](_0x30a13b['attributes'],function(_0x3e2b96){const _0x300cf8=_0x16958f,_0x432239={};return _0x432239[_0x3e2b96]={[Op[_0x300cf8('0x6')]]:'%'+_0x5f2fdf[_0x300cf8('0xf')]['filter']+'%'},_0x432239;})})),_0x30a13b=_[_0x16958f('0x3e')]({},_0x30a13b,_0x5f2fdf[_0x16958f('0x7')]),_0x441f67[_0x16958f('0x37')](_0x30a13b);})[_0x30240c('0x23')](function(_0x7659f7){const _0x3cfd6f=_0x30240c;if(_0x7659f7)return _0x4f5828=_0x7659f7['length'],typeof _0x5f2fdf[_0x3cfd6f('0xf')][_0x3cfd6f('0x1')]===_0x3cfd6f('0x1e')&&(_0x30a13b[_0x3cfd6f('0x29')]=qs[_0x3cfd6f('0x29')](_0x5f2fdf['query'][_0x3cfd6f('0x29')]),_0x30a13b[_0x3cfd6f('0x31')]=qs[_0x3cfd6f('0x31')](_0x5f2fdf['query'][_0x3cfd6f('0x31')])),_0x441f67['getAllConditions'](_0x30a13b);})[_0x30240c('0x23')](function(_0x328fef){if(_0x328fef)return _0x328fef?{'count':_0x4f5828,'rows':_0x328fef}:null;})[_0x30240c('0x23')](respondWithResult(_0x4f8923,null))[_0x30240c('0x16')](handleError(_0x4f8923,null));},exports[_0x23b718('0x2a')]=function(_0x7e3d00,_0x48ac20){const _0x2ec325=_0x23b718;let _0x5b928f={};const _0xb18b1={};let _0x47be4b,_0x21949d;return db[_0x2ec325('0x21')][_0x2ec325('0x0')]({'where':{'id':_0x7e3d00[_0x2ec325('0x42')]['id']}})[_0x2ec325('0x23')](handleEntityNotFound(_0x48ac20,null))[_0x2ec325('0x23')](function(_0x520589){const _0x1d47b4=_0x2ec325;if(_0x520589)return _0x47be4b=_0x520589,_0xb18b1[_0x1d47b4('0x20')]=_[_0x1d47b4('0x8')](db[_0x1d47b4('0x9')][_0x1d47b4('0x26')]),_0xb18b1[_0x1d47b4('0xf')]=_[_0x1d47b4('0x8')](_0x7e3d00[_0x1d47b4('0xf')]),_0xb18b1[_0x1d47b4('0x38')]=_[_0x1d47b4('0x3a')](_0xb18b1['model'],_0xb18b1[_0x1d47b4('0xf')]),_0x5b928f[_0x1d47b4('0x1d')]=_[_0x1d47b4('0x3a')](_0xb18b1[_0x1d47b4('0x20')],qs['fields'](_0x7e3d00['query'][_0x1d47b4('0x3d')])),_0x5b928f['attributes']=_0x5b928f[_0x1d47b4('0x1d')][_0x1d47b4('0x24')]?_0x5b928f['attributes']:_0xb18b1[_0x1d47b4('0x20')],_0x5b928f['order']=qs['sort'](_0x7e3d00[_0x1d47b4('0xf')][_0x1d47b4('0xc')]),_0x5b928f[_0x1d47b4('0xb')]=qs['filters'](_[_0x1d47b4('0xe')](_0x7e3d00[_0x1d47b4('0xf')],_0xb18b1[_0x1d47b4('0x38')])),_0x7e3d00[_0x1d47b4('0xf')][_0x1d47b4('0x33')]&&(_0x5b928f['where']=_[_0x1d47b4('0x3e')](_0x5b928f['where'],{[Op['or']]:_[_0x1d47b4('0x44')](_0x5b928f['attributes'],function(_0x410be5){const _0x5d648f=_0x1d47b4,_0x13fc9a={};return _0x13fc9a[_0x410be5]={[Op[_0x5d648f('0x6')]]:'%'+_0x7e3d00[_0x5d648f('0xf')][_0x5d648f('0x33')]+'%'},_0x13fc9a;})})),_0x5b928f=_['merge']({},_0x5b928f,_0x7e3d00['options']),_0x47be4b['getAnyConditions'](_0x5b928f);})[_0x2ec325('0x23')](function(_0x411e66){const _0x584e78=_0x2ec325;if(_0x411e66)return _0x21949d=_0x411e66[_0x584e78('0x24')],typeof _0x7e3d00['query'][_0x584e78('0x1')]===_0x584e78('0x1e')&&(_0x5b928f[_0x584e78('0x29')]=qs['limit'](_0x7e3d00[_0x584e78('0xf')][_0x584e78('0x29')]),_0x5b928f[_0x584e78('0x31')]=qs[_0x584e78('0x31')](_0x7e3d00[_0x584e78('0xf')][_0x584e78('0x31')])),_0x47be4b[_0x584e78('0x2a')](_0x5b928f);})[_0x2ec325('0x23')](function(_0x46de43){if(_0x46de43)return _0x46de43?{'count':_0x21949d,'rows':_0x46de43}:null;})[_0x2ec325('0x23')](respondWithResult(_0x48ac20,null))[_0x2ec325('0x16')](handleError(_0x48ac20,null));},exports[_0x23b718('0x40')]=function(_0x5b4de3,_0x21d9ba){const _0x180a85=_0x23b718;return _0x5b4de3[_0x180a85('0x45')]['id']&&delete _0x5b4de3[_0x180a85('0x45')]['id'],db[_0x180a85('0x21')][_0x180a85('0x0')]({'where':{'id':_0x5b4de3[_0x180a85('0x42')]['id']}})[_0x180a85('0x23')](handleEntityNotFound(_0x21d9ba,null))['then'](function(_0x5ed70c){const _0x365758=_0x180a85;if(_0x5ed70c)return _0x5b4de3['body'][_0x365758('0x39')]=_0x5ed70c['id'],db[_0x365758('0xa')][_0x365758('0x25')](_0x5b4de3[_0x365758('0x45')]);})[_0x180a85('0x23')](respondWithResult(_0x21d9ba,null))[_0x180a85('0x16')](handleError(_0x21d9ba,null));},exports['getActions']=function(_0x379a1d,_0x4adb5e){const _0x3476a1=_0x23b718;let _0x5de25b={};const _0xb2fd78={};let _0x45548c,_0x59a19f;return db[_0x3476a1('0x21')][_0x3476a1('0x0')]({'where':{'id':_0x379a1d[_0x3476a1('0x42')]['id']}})[_0x3476a1('0x23')](handleEntityNotFound(_0x4adb5e,null))[_0x3476a1('0x23')](function(_0x429883){const _0x1867a6=_0x3476a1;if(_0x429883)return _0x45548c=_0x429883,_0xb2fd78['model']=_[_0x1867a6('0x8')](db[_0x1867a6('0xa')][_0x1867a6('0x26')]),_0xb2fd78['query']=_[_0x1867a6('0x8')](_0x379a1d['query']),_0xb2fd78[_0x1867a6('0x38')]=_[_0x1867a6('0x3a')](_0xb2fd78[_0x1867a6('0x20')],_0xb2fd78[_0x1867a6('0xf')]),_0x5de25b[_0x1867a6('0x1d')]=_['intersection'](_0xb2fd78['model'],qs['fields'](_0x379a1d[_0x1867a6('0xf')][_0x1867a6('0x3d')])),_0x5de25b[_0x1867a6('0x1d')]=_0x5de25b[_0x1867a6('0x1d')][_0x1867a6('0x24')]?_0x5de25b[_0x1867a6('0x1d')]:_0xb2fd78[_0x1867a6('0x20')],_0x5de25b[_0x1867a6('0x41')]=qs[_0x1867a6('0xc')](_0x379a1d[_0x1867a6('0xf')][_0x1867a6('0xc')]),_0x5de25b[_0x1867a6('0xb')]=qs['filters'](_[_0x1867a6('0xe')](_0x379a1d['query'],_0xb2fd78[_0x1867a6('0x38')])),_0x379a1d[_0x1867a6('0xf')][_0x1867a6('0x33')]&&(_0x5de25b[_0x1867a6('0xb')]=_[_0x1867a6('0x3e')](_0x5de25b[_0x1867a6('0xb')],{[Op['or']]:_[_0x1867a6('0x44')](_0x5de25b[_0x1867a6('0x1d')],function(_0x3a4d4e){const _0x147719=_0x1867a6,_0x637ba={};return _0x637ba[_0x3a4d4e]={[Op[_0x147719('0x6')]]:'%'+_0x379a1d[_0x147719('0xf')][_0x147719('0x33')]+'%'},_0x637ba;})})),_0x5de25b=_['merge']({},_0x5de25b,_0x379a1d[_0x1867a6('0x7')]),_0x45548c[_0x1867a6('0x2c')](_0x5de25b);})['then'](function(_0x2864d0){const _0x7d365c=_0x3476a1;if(_0x2864d0)return _0x59a19f=_0x2864d0['length'],typeof _0x379a1d['query'][_0x7d365c('0x1')]==='undefined'&&(_0x5de25b[_0x7d365c('0x29')]=qs[_0x7d365c('0x29')](_0x379a1d[_0x7d365c('0xf')]['limit']),_0x5de25b[_0x7d365c('0x31')]=qs[_0x7d365c('0x31')](_0x379a1d['query'][_0x7d365c('0x31')])),_0x45548c[_0x7d365c('0x2c')](_0x5de25b);})[_0x3476a1('0x23')](function(_0x275fac){if(_0x275fac)return _0x275fac?{'count':_0x59a19f,'rows':_0x275fac}:null;})[_0x3476a1('0x23')](respondWithResult(_0x4adb5e,null))[_0x3476a1('0x16')](handleError(_0x4adb5e,null));};
\ No newline at end of file