620ad3d25ae94edc0faab031dd89429e5157d768
[motion-next.git] / server / api / voicePrefix / voicePrefix.controller.js
1 const a746_0xb939=['intersection','app','then','undefined','status','user','filter','error','callerIdAll','lodash','../../config/logger','Extensions\x20creation\x20failed','appdata','end','json','Voice\x20Prefix\x20Extension','includeAll','order','Set','isArray','describe','VoiceExtension','exten','role','CDR(prefix)=','prefix','removeAgents','UserProfileResource','goto','fields','sort','api','update','priority','query','attributes','userVoicePrefix:remove','key','transaction','system-','ids','userProfileId','merge','set','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','No\x20callerid\x20available','show','map','name','${EXTEN:','User','addAgents','findOne','userVoicePrefix:save','VoicePrefix','rawAttributes','NoOp','VoiceExtensionId','Content-Range','params','charAt','../../components/parsers/qs','sendStatus','register','./voicePrefix.socket','count','send','omit','push','offset','VoicePrefixId','sequelize','UserProfileSection','emit','from-sip','include','like','get','context','keys','create','getAgents','filters','limit','index','../../rediscache','model','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','../../mysqldb','length','pick','findByPk','type','where','VoicePrefixes','destroy','rows','VIRTUAL','options','nolimit'];(function(_0xb0fde1,_0xb93957){const _0x4a5d5e=function(_0x1b1009){while(--_0x1b1009){_0xb0fde1['push'](_0xb0fde1['shift']());}};_0x4a5d5e(++_0xb93957);}(a746_0xb939,0xb5));const a746_0x4a5d=function(_0xb0fde1,_0xb93957){_0xb0fde1=_0xb0fde1-0x0;let _0x4a5d5e=a746_0xb939[_0xb0fde1];return _0x4a5d5e;};const _0x4f3ff4=a746_0x4a5d;'use strict';const _=require(_0x4f3ff4('0x20')),qs=require(_0x4f3ff4('0x55')),logger=require(_0x4f3ff4('0x21'))(_0x4f3ff4('0x36')),{getSocket}=require(_0x4f3ff4('0x7')),socket=getSocket(),db=require(_0x4f3ff4('0xb'))['db'],{Op}=require(_0x4f3ff4('0x5f'));require(_0x4f3ff4('0x58'))[_0x4f3ff4('0x57')](socket);function respondWithStatusCode(_0x1b1009,_0x23ec85){return _0x23ec85=_0x23ec85||0xcc,function(_0x5721ed){const _0x114a88=a746_0x4a5d;if(_0x5721ed)return _0x1b1009[_0x114a88('0x56')](_0x23ec85);return _0x1b1009['status'](_0x23ec85)[_0x114a88('0x24')]();};}function respondWithResult(_0x249e37,_0x34a7ba){return _0x34a7ba=_0x34a7ba||0xc8,function(_0x2f3022){const _0x275fa3=a746_0x4a5d;if(_0x2f3022)return _0x249e37[_0x275fa3('0x1b')](_0x34a7ba)[_0x275fa3('0x25')](_0x2f3022);};}function respondWithFilteredResult(_0x5dd05a,_0x5f5644){return function(_0x59a3e7){const _0x46067a=a746_0x4a5d;if(_0x59a3e7){const _0x3cbaee=_0x59a3e7[_0x46067a('0x59')],_0x3649cb=_0x5f5644[_0x46067a('0x5d')];let _0x514dc4=_0x5f5644[_0x46067a('0x5d')]+_0x5f5644['limit'],_0x13516d;return _0x514dc4>=_0x3cbaee?(_0x514dc4=_0x3cbaee,_0x13516d=0xc8):_0x13516d=0xce,_0x5dd05a['status'](_0x13516d),_0x5dd05a[_0x46067a('0x42')](_0x46067a('0x52'),_0x3649cb+'-'+_0x514dc4+'/'+_0x3cbaee)[_0x46067a('0x25')](_0x59a3e7);}return null;};}function removeEntity(_0x2eb7fc){return function(_0x46ae58){const _0x15752f=a746_0x4a5d;if(_0x46ae58)return _0x46ae58['destroy']()[_0x15752f('0x19')](function(){const _0x4e38d7=_0x15752f,_0x430106=_0x46ae58[_0x4e38d7('0x65')]({'plain':!![]}),_0x460d98='VoicePrefixes';return db['UserProfileResource'][_0x4e38d7('0x12')]({'where':{'type':_0x460d98,'resourceId':_0x430106['id']}})['then'](function(){return _0x46ae58;});})[_0x15752f('0x19')](function(){const _0x3090c4=_0x15752f;_0x2eb7fc['status'](0xcc)[_0x3090c4('0x24')]();});};}function handleEntityNotFound(_0xf4911b){return function(_0x132798){const _0x5db4ea=a746_0x4a5d;return!_0x132798&&_0xf4911b[_0x5db4ea('0x56')](0x194),_0x132798;};}function handleError(_0x9a3cdd,_0x56efba){return _0x56efba=_0x56efba||0x1f4,function(_0x3d8ba5){const _0x5d906e=a746_0x4a5d;logger[_0x5d906e('0x1e')](_0x3d8ba5['stack']),_0x3d8ba5['name']&&delete _0x3d8ba5[_0x5d906e('0x48')],_0x9a3cdd['status'](_0x56efba)[_0x5d906e('0x5a')](_0x3d8ba5);};}exports[_0x4f3ff4('0x6')]=function(_0x9a10bb,_0x508bea){const _0x1cdc32=_0x4f3ff4;let _0x541f55={};const _0x1b06f6={},_0x4b1ad0={'count':0x0,'rows':[]},_0x51b928=_[_0x1cdc32('0x47')](db[_0x1cdc32('0x4e')][_0x1cdc32('0x4f')],function(_0x5d2c3f){const _0x28d06b=_0x1cdc32;return{'name':_0x5d2c3f['fieldName'],'type':_0x5d2c3f[_0x28d06b('0xf')][_0x28d06b('0x3c')]};});_0x1b06f6[_0x1cdc32('0x8')]=_[_0x1cdc32('0x47')](_0x51b928,'name'),_0x1b06f6[_0x1cdc32('0x39')]=_[_0x1cdc32('0x1')](_0x9a10bb[_0x1cdc32('0x39')]),_0x1b06f6[_0x1cdc32('0x4')]=_[_0x1cdc32('0x17')](_0x1b06f6[_0x1cdc32('0x8')],_0x1b06f6[_0x1cdc32('0x39')]),_0x541f55[_0x1cdc32('0x3a')]=_['intersection'](_0x1b06f6[_0x1cdc32('0x8')],qs[_0x1cdc32('0x34')](_0x9a10bb['query'][_0x1cdc32('0x34')])),_0x541f55[_0x1cdc32('0x3a')]=_0x541f55['attributes'][_0x1cdc32('0xc')]?_0x541f55[_0x1cdc32('0x3a')]:_0x1b06f6['model'];typeof _0x9a10bb['query'][_0x1cdc32('0x16')]===_0x1cdc32('0x1a')&&(_0x541f55[_0x1cdc32('0x5')]=qs[_0x1cdc32('0x5')](_0x9a10bb['query'][_0x1cdc32('0x5')]),_0x541f55[_0x1cdc32('0x5d')]=qs[_0x1cdc32('0x5d')](_0x9a10bb[_0x1cdc32('0x39')]['offset']));_0x541f55[_0x1cdc32('0x28')]=qs[_0x1cdc32('0x35')](_0x9a10bb[_0x1cdc32('0x39')][_0x1cdc32('0x35')]),_0x541f55[_0x1cdc32('0x10')]=qs[_0x1cdc32('0x4')](_[_0x1cdc32('0xd')](_0x9a10bb[_0x1cdc32('0x39')],_0x1b06f6['filters']),_0x51b928);_0x9a10bb[_0x1cdc32('0x39')][_0x1cdc32('0x1d')]&&(_0x541f55[_0x1cdc32('0x10')]=_[_0x1cdc32('0x41')](_0x541f55[_0x1cdc32('0x10')],{[Op['or']]:_[_0x1cdc32('0x47')](_0x51b928,function(_0x4583de){const _0x392c21=_0x1cdc32;if(_0x4583de[_0x392c21('0xf')]!==_0x392c21('0x14')){const _0xe5cf1c={};return _0xe5cf1c[_0x4583de['name']]={[Op[_0x392c21('0x64')]]:'%'+_0x9a10bb[_0x392c21('0x39')]['filter']+'%'},_0xe5cf1c;}})}));_0x541f55=_[_0x1cdc32('0x41')]({},_0x541f55,_0x9a10bb['options']);const _0x549ba3={'where':_0x541f55[_0x1cdc32('0x10')]};return db[_0x1cdc32('0x4e')][_0x1cdc32('0x59')](_0x549ba3)[_0x1cdc32('0x19')](function(_0x4c003f){const _0x31f65b=_0x1cdc32;return _0x4b1ad0[_0x31f65b('0x59')]=_0x4c003f,_0x9a10bb['query'][_0x31f65b('0x27')]&&(_0x541f55[_0x31f65b('0x63')]=[{'all':!![]}]),db[_0x31f65b('0x4e')]['findAll'](_0x541f55);})[_0x1cdc32('0x19')](function(_0x3b4136){const _0x9970a5=_0x1cdc32;return _0x4b1ad0[_0x9970a5('0x13')]=_0x3b4136,_0x4b1ad0;})[_0x1cdc32('0x19')](respondWithFilteredResult(_0x508bea,_0x541f55))[_0x1cdc32('0x44')](handleError(_0x508bea,null));},exports[_0x4f3ff4('0x46')]=function(_0x2a155c,_0x4e7c91){const _0x11eb40=_0x4f3ff4;let _0x59f674={'raw':![],'where':{'id':_0x2a155c[_0x11eb40('0x53')]['id']}};const _0x489217={};return _0x489217[_0x11eb40('0x8')]=_[_0x11eb40('0x1')](db[_0x11eb40('0x4e')][_0x11eb40('0x4f')]),_0x489217[_0x11eb40('0x39')]=_[_0x11eb40('0x1')](_0x2a155c[_0x11eb40('0x39')]),_0x489217[_0x11eb40('0x4')]=_['intersection'](_0x489217[_0x11eb40('0x8')],_0x489217[_0x11eb40('0x39')]),_0x59f674['attributes']=_[_0x11eb40('0x17')](_0x489217[_0x11eb40('0x8')],qs[_0x11eb40('0x34')](_0x2a155c['query']['fields'])),_0x59f674[_0x11eb40('0x3a')]=_0x59f674[_0x11eb40('0x3a')][_0x11eb40('0xc')]?_0x59f674['attributes']:_0x489217[_0x11eb40('0x8')],_0x2a155c[_0x11eb40('0x39')]['includeAll']&&(_0x59f674['include']=[{'all':!![]}]),_0x59f674=_['merge']({},_0x59f674,_0x2a155c[_0x11eb40('0x15')]),db['VoicePrefix'][_0x11eb40('0x4c')](_0x59f674)[_0x11eb40('0x19')](handleEntityNotFound(_0x4e7c91,null))[_0x11eb40('0x19')](respondWithResult(_0x4e7c91,null))['catch'](handleError(_0x4e7c91,null));},exports[_0x4f3ff4('0x12')]=function(_0xc8e791,_0x12f9db){const _0x3436ca=_0x4f3ff4;return db[_0x3436ca('0x4e')][_0x3436ca('0x4c')]({'where':{'id':_0xc8e791['params']['id']}})['then'](handleEntityNotFound(_0x12f9db,null))['then'](removeEntity(_0x12f9db,null))[_0x3436ca('0x44')](handleError(_0x12f9db,null));},exports['describe']=function(_0x3539d5,_0xcf9b40){const _0x443676=_0x4f3ff4;return db[_0x443676('0x4e')][_0x443676('0x2b')]()[_0x443676('0x19')](respondWithResult(_0xcf9b40,null))[_0x443676('0x44')](handleError(_0xcf9b40,null));},exports['create']=function(_0x7386d9,_0x1cd068){const _0x36eef7=_0x4f3ff4;let _0x533563;return db[_0x36eef7('0x5f')]['transaction'](function(_0x1a8755){const _0x230fd5=_0x36eef7;return db[_0x230fd5('0x4e')][_0x230fd5('0x2')](_0x7386d9['body'],{'transaction':_0x1a8755})[_0x230fd5('0x19')](function(_0x15f0ce){const _0x312da6=_0x230fd5;return _0x533563=_0x15f0ce[_0x312da6('0x65')]({'plain':!![]}),db[_0x312da6('0x2c')][_0x312da6('0x4c')]({'where':{'id':_0x533563[_0x312da6('0x51')]},'raw':!![]})[_0x312da6('0x19')](function(_0x27ce67){return createVoicePrefixExtensions(_0x533563,_0x27ce67,_0x1a8755);});});})[_0x36eef7('0x19')](function(){const _0x259d9a=_0x36eef7,_0x325fc5=_0x7386d9[_0x259d9a('0x1c')]['get']({'plain':!![]});if(!_0x325fc5)throw new Error(_0x259d9a('0xa'));if(_0x325fc5[_0x259d9a('0x2e')]===_0x259d9a('0x1c')){const _0x2dd75f=_0x533563;return db[_0x259d9a('0x60')][_0x259d9a('0x4c')]({'where':{'name':_0x259d9a('0x11'),'userProfileId':_0x325fc5[_0x259d9a('0x40')]},'raw':!![]})['then'](function(_0x5cd0fb){const _0x871fcb=_0x259d9a;return _0x5cd0fb&&_0x5cd0fb['autoAssociation']===0x0?db[_0x871fcb('0x32')]['create']({'name':_0x2dd75f[_0x871fcb('0x48')],'resourceId':_0x2dd75f['id'],'type':_0x5cd0fb[_0x871fcb('0x48')],'sectionId':_0x5cd0fb['id']},{})[_0x871fcb('0x19')](function(){return _0x533563;}):_0x533563;})[_0x259d9a('0x44')](function(_0x5d7d67){const _0x34037f=_0x259d9a;logger[_0x34037f('0x1e')](_0x34037f('0x43'),_0x5d7d67);throw _0x5d7d67;});}return _0x533563;})[_0x36eef7('0x19')](respondWithResult(_0x1cd068,null))[_0x36eef7('0x44')](handleError(_0x1cd068,null));};function Extension(_0x4a55d1,_0x95aff5,_0x53fff9,_0xcad56b){const _0x4be111=_0x4f3ff4;this[_0x4be111('0x0')]=_0x4be111('0x62'),this[_0x4be111('0x2d')]=_0x4a55d1,this[_0x4be111('0x18')]=_0x53fff9,this[_0x4be111('0xf')]='system',this['description']=_0x4be111('0x26'),this[_0x4be111('0x38')]=_0x95aff5,this[_0x4be111('0x23')]=_0xcad56b;}function createVoicePrefixExtensions(_0x1cda5c,_0x559463,_0x4f98b4){return new Promise(function(_0x1bbbc7,_0x41c875){const _0x4a6281=a746_0x4a5d,_0x4c0d2a=new Extension(formatPrefixName(_0x1cda5c[_0x4a6281('0x30')]),0x1,_0x4a6281('0x50'),'Voice\x20Prefix');return _0x4c0d2a[_0x4a6281('0x5e')]=_0x1cda5c['id'],db[_0x4a6281('0x2c')][_0x4a6281('0x2')](_0x4c0d2a,{'transaction':_0x4f98b4})[_0x4a6281('0x19')](function(_0x2b5d34){const _0x2239bf=_0x4a6281,_0x593713=_0x2b5d34[_0x2239bf('0x65')]({'plain':!![]}),_0x3fe0d2=_[_0x2239bf('0x47')](addVoicePrefixExtensions(_0x1cda5c,_0x559463),function(_0x5d32c1){const _0x4b9d13=_0x2239bf;return _0x5d32c1[_0x4b9d13('0x51')]=_0x593713['id'],_0x5d32c1[_0x4b9d13('0x5e')]=_0x1cda5c['id'],_0x5d32c1;});return db[_0x2239bf('0x2c')]['bulkCreate'](_0x3fe0d2,{'transaction':_0x4f98b4})[_0x2239bf('0x19')](function(_0x16e949){const _0xb3f387=_0x2239bf;return!_0x16e949?_0x41c875(_0xb3f387('0x22')):_0x1bbbc7(_0x16e949);})[_0x2239bf('0x44')](function(_0x4592e7){return _0x41c875(_0x4592e7);});});});}function addVoicePrefixExtensions(_0x55e99e,_0x283e57){const _0x5df407=_0x4f3ff4,_0x3b1d64=[],_0x2201d9=formatPrefixName(_0x55e99e['prefix']);return _0x3b1d64[_0x5df407('0x5c')](new Extension(_0x2201d9,0x2,_0x5df407('0x29'),_0x5df407('0x2f')+_0x55e99e[_0x5df407('0x48')])),_0x55e99e[_0x5df407('0x1f')]?_0x3b1d64['push'](new Extension(_0x2201d9,0x3,_0x5df407('0x29'),'PREFIX-CALLERIDALL='+_0x55e99e[_0x5df407('0x1f')])):_0x3b1d64['push'](new Extension(_0x2201d9,0x3,_0x5df407('0x50'),_0x5df407('0x45'))),_0x3b1d64['push'](new Extension(_0x2201d9,0x4,_0x5df407('0x33'),_0x283e57['context']+','+_0x5df407('0x49')+(0x8+_0x55e99e[_0x5df407('0x48')][_0x5df407('0xc')])+'}'+','+0x1)),_0x3b1d64;}function formatPrefixName(_0x5849a2){const _0x3aeb70=_0x4f3ff4;let _0x56cf00='_';for(let _0x149fe0=0x0;_0x149fe0<_0x5849a2[_0x3aeb70('0xc')];_0x149fe0++){_0x5849a2[_0x3aeb70('0x54')](_0x149fe0)=='-'?_0x56cf00+=_0x5849a2[_0x3aeb70('0x54')](_0x149fe0):_0x56cf00+='['+_0x5849a2[_0x3aeb70('0x54')](_0x149fe0)+']';}return _0x56cf00+='.',_0x56cf00;}exports[_0x4f3ff4('0x37')]=function(_0x3c7159,_0xc6fd37){const _0xf724cf=_0x4f3ff4,_0x5777b4=_0x3c7159[_0xf724cf('0x9')];return _0x5777b4['prefix']=_0xf724cf('0x3e')+_0x5777b4['name']+'-',db[_0xf724cf('0x5f')][_0xf724cf('0x3d')](function(_0x54850b){const _0x1aa252=_0xf724cf;return db['VoicePrefix'][_0x1aa252('0x37')](_0x5777b4,{'where':{'id':_0x5777b4['id']},'transaction':_0x54850b})['then'](function(){const _0x409c73=_0x1aa252;return db['VoiceExtension'][_0x409c73('0x12')]({'where':{'VoicePrefixId':_0x5777b4['id']},'transaction':_0x54850b})['then'](function(){const _0x3690ee=_0x409c73;return db[_0x3690ee('0x2c')][_0x3690ee('0x4c')]({'where':{'id':_0x5777b4[_0x3690ee('0x51')]},'raw':!![]})[_0x3690ee('0x19')](function(_0x18e9d5){return createVoicePrefixExtensions(_0x5777b4,_0x18e9d5,_0x54850b);});});});})[_0xf724cf('0x19')](function(){const _0x3a5640=_0xf724cf;return db[_0x3a5640('0x4e')][_0x3a5640('0xe')](_0x5777b4['id']);})['then'](respondWithResult(_0xc6fd37,null))[_0xf724cf('0x44')](handleError(_0xc6fd37,null));},exports[_0x4f3ff4('0x4b')]=function(_0xe4289c,_0x43a173){const _0x2585c9=_0x4f3ff4;return db[_0x2585c9('0x4e')][_0x2585c9('0x4c')]({'where':{'id':_0xe4289c[_0x2585c9('0x53')]['id']}})[_0x2585c9('0x19')](function(_0x2b4600){const _0x16e50b=_0x2585c9;if(_0x2b4600)return _0x2b4600[_0x16e50b('0x4b')](_0xe4289c[_0x16e50b('0x9')][_0x16e50b('0x3f')],{'through':_[_0x16e50b('0x5b')](_0xe4289c['body'],[_0x16e50b('0x3f'),'id'])})[_0x16e50b('0x19')](function(_0x58f7ed){const _0x1ff9ec=_0x16e50b;for(let _0x3b5d7a=0x0;_0x3b5d7a<_0xe4289c[_0x1ff9ec('0x9')]['ids'][_0x1ff9ec('0xc')];_0x3b5d7a+=0x1){socket[_0x1ff9ec('0x61')](_0x1ff9ec('0x4d'),{'UserId':_0xe4289c[_0x1ff9ec('0x9')][_0x1ff9ec('0x3f')][_0x3b5d7a],'VoicePrefixId':_0xe4289c[_0x1ff9ec('0x53')]['id']});}return _0x58f7ed;});})[_0x2585c9('0x19')](respondWithResult(_0x43a173,null))[_0x2585c9('0x44')](handleError(_0x43a173,null));},exports['removeAgents']=function(_0x2cf095,_0x4975b0){const _0x4391bc=_0x4f3ff4;return db[_0x4391bc('0x4e')]['findOne']({'where':{'id':_0x2cf095[_0x4391bc('0x53')]['id']}})[_0x4391bc('0x19')](handleEntityNotFound(_0x4975b0,null))[_0x4391bc('0x19')](function(_0x3a90ff){const _0x3aab8a=_0x4391bc;if(_0x3a90ff)return _0x3a90ff[_0x3aab8a('0x31')](_0x2cf095[_0x3aab8a('0x39')][_0x3aab8a('0x3f')])['then'](function(){const _0x393ff5=_0x3aab8a;if(_[_0x393ff5('0x2a')](_0x2cf095[_0x393ff5('0x39')][_0x393ff5('0x3f')]))for(let _0x39ba5e=0x0;_0x39ba5e<_0x2cf095[_0x393ff5('0x39')]['ids'][_0x393ff5('0xc')];_0x39ba5e+=0x1){socket[_0x393ff5('0x61')](_0x393ff5('0x3b'),{'UserId':Number(_0x2cf095[_0x393ff5('0x39')]['ids'][_0x39ba5e]),'VoicePrefixId':Number(_0x2cf095['params']['id'])});}else socket[_0x393ff5('0x61')](_0x393ff5('0x3b'),{'UserId':Number(_0x2cf095['query'][_0x393ff5('0x3f')]),'VoicePrefixId':Number(_0x2cf095[_0x393ff5('0x53')]['id'])});});})[_0x4391bc('0x19')](respondWithStatusCode(_0x4975b0,null))[_0x4391bc('0x44')](handleError(_0x4975b0,null));},exports['getAgents']=function(_0x4c30bc,_0x1f2ad2){const _0x9d31e2=_0x4f3ff4;let _0x3786f1={};const _0x52b0fd={};let _0x4acce3,_0x358e7a;return db['VoicePrefix'][_0x9d31e2('0x4c')]({'where':{'id':_0x4c30bc[_0x9d31e2('0x53')]['id']}})[_0x9d31e2('0x19')](handleEntityNotFound(_0x1f2ad2,null))['then'](function(_0x404158){const _0x35224b=_0x9d31e2;if(_0x404158)return _0x4acce3=_0x404158,_0x52b0fd[_0x35224b('0x8')]=_[_0x35224b('0x1')](db[_0x35224b('0x4a')][_0x35224b('0x4f')]),_0x52b0fd[_0x35224b('0x39')]=_[_0x35224b('0x1')](_0x4c30bc[_0x35224b('0x39')]),_0x52b0fd[_0x35224b('0x4')]=_[_0x35224b('0x17')](_0x52b0fd[_0x35224b('0x8')],_0x52b0fd['query']),_0x3786f1[_0x35224b('0x3a')]=_[_0x35224b('0x17')](_0x52b0fd['model'],qs[_0x35224b('0x34')](_0x4c30bc['query'][_0x35224b('0x34')])),_0x3786f1['attributes']=_0x3786f1[_0x35224b('0x3a')][_0x35224b('0xc')]?_0x3786f1['attributes']:_0x52b0fd[_0x35224b('0x8')],_0x3786f1[_0x35224b('0x28')]=qs[_0x35224b('0x35')](_0x4c30bc[_0x35224b('0x39')][_0x35224b('0x35')]),_0x3786f1[_0x35224b('0x10')]=qs[_0x35224b('0x4')](_['pick'](_0x4c30bc['query'],_0x52b0fd[_0x35224b('0x4')])),_0x4c30bc[_0x35224b('0x39')][_0x35224b('0x1d')]&&(_0x3786f1['where']=_[_0x35224b('0x41')](_0x3786f1['where'],{[Op['or']]:_[_0x35224b('0x47')](_0x3786f1[_0x35224b('0x3a')],function(_0x48a53a){const _0x2770db=_0x35224b,_0x31b3c4={};return _0x31b3c4[_0x48a53a]={[Op[_0x2770db('0x64')]]:'%'+_0x4c30bc['query'][_0x2770db('0x1d')]+'%'},_0x31b3c4;})})),_0x3786f1=_[_0x35224b('0x41')]({},_0x3786f1,_0x4c30bc[_0x35224b('0x15')]),_0x4acce3[_0x35224b('0x3')](_0x3786f1);})[_0x9d31e2('0x19')](function(_0x37ce0f){const _0x4a6d99=_0x9d31e2;if(_0x37ce0f)return _0x358e7a=_0x37ce0f[_0x4a6d99('0xc')],typeof _0x4c30bc['query'][_0x4a6d99('0x16')]===_0x4a6d99('0x1a')&&(_0x3786f1[_0x4a6d99('0x5')]=qs[_0x4a6d99('0x5')](_0x4c30bc[_0x4a6d99('0x39')][_0x4a6d99('0x5')]),_0x3786f1[_0x4a6d99('0x5d')]=qs['offset'](_0x4c30bc[_0x4a6d99('0x39')][_0x4a6d99('0x5d')])),_0x4acce3[_0x4a6d99('0x3')](_0x3786f1);})['then'](function(_0x482332){if(_0x482332)return _0x482332?{'count':_0x358e7a,'rows':_0x482332}:null;})[_0x9d31e2('0x19')](respondWithResult(_0x1f2ad2,null))[_0x9d31e2('0x44')](handleError(_0x1f2ad2,null));};