Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / cmContactHasItem / cmContactHasItem.controller.js
index 021783b..63664aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18b9=['Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','map','CmContactHasItem','rawAttributes','fieldName','type','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','create','body','user'];(function(_0x5aada8,_0x460a35){var _0xf5247e=function(_0x507709){while(--_0x507709){_0x5aada8['push'](_0x5aada8['shift']());}};_0xf5247e(++_0x460a35);}(_0x18b9,0x148));var _0x918b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x18b9[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x918b('0x0'));var rimraf=require(_0x918b('0x1'));var zipdir=require(_0x918b('0x2'));var jsonpatch=require(_0x918b('0x3'));var rp=require(_0x918b('0x4'));var moment=require('moment');var BPromise=require(_0x918b('0x5'));var Mustache=require(_0x918b('0x6'));var util=require('util');var path=require(_0x918b('0x7'));var sox=require(_0x918b('0x8'));var csv=require(_0x918b('0x9'));var ejs=require(_0x918b('0xa'));var fs=require('fs');var fs_extra=require(_0x918b('0xb'));var _=require('lodash');var squel=require(_0x918b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x918b('0x9'));var querystring=require(_0x918b('0xd'));var Papa=require(_0x918b('0xe'));var Redis=require(_0x918b('0xf'));var authService=require(_0x918b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x918b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x918b('0x12'))(_0x918b('0x13'));var utils=require(_0x918b('0x14'));var config=require(_0x918b('0x15'));var licenseUtil=require(_0x918b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x532b37,_0x34f740){_0x34f740=_0x34f740||0xcc;return function(_0x392408){if(_0x392408){return _0x532b37[_0x918b('0x17')](_0x34f740);}return _0x532b37[_0x918b('0x18')](_0x34f740)[_0x918b('0x19')]();};}function respondWithResult(_0x446695,_0x4d695e){_0x4d695e=_0x4d695e||0xc8;return function(_0xd58cbe){if(_0xd58cbe){return _0x446695[_0x918b('0x18')](_0x4d695e)[_0x918b('0x1a')](_0xd58cbe);}};}function respondWithFilteredResult(_0x4b3232,_0x32667a){return function(_0x545228){if(_0x545228){var _0x3c8a27=typeof _0x32667a[_0x918b('0x1b')]==='undefined'&&typeof _0x32667a[_0x918b('0x1c')]==='undefined';var _0x153edc=_0x545228[_0x918b('0x1d')];var _0x291c39=_0x3c8a27?0x0:_0x32667a[_0x918b('0x1b')];var _0xb42b32=_0x3c8a27?_0x545228[_0x918b('0x1d')]:_0x32667a['offset']+_0x32667a[_0x918b('0x1c')];var _0x5d3090;if(_0xb42b32>=_0x153edc){_0xb42b32=_0x153edc;_0x5d3090=0xc8;}else{_0x5d3090=0xce;}_0x4b3232[_0x918b('0x18')](_0x5d3090);return _0x4b3232[_0x918b('0x1e')](_0x918b('0x1f'),_0x291c39+'-'+_0xb42b32+'/'+_0x153edc)[_0x918b('0x1a')](_0x545228);}return null;};}function patchUpdates(_0x5c8fbd){return function(_0x5b27de){try{jsonpatch['apply'](_0x5b27de,_0x5c8fbd,!![]);}catch(_0x28356e){return BPromise[_0x918b('0x20')](_0x28356e);}return _0x5b27de[_0x918b('0x21')]();};}function saveUpdates(_0x5e7d43,_0x5a9dce){return function(_0x1f16c4){if(_0x1f16c4){return _0x1f16c4[_0x918b('0x22')](_0x5e7d43)[_0x918b('0x23')](function(_0x47c828){return _0x47c828;});}return null;};}function removeEntity(_0x249f09,_0x38764b){return function(_0x862156){if(_0x862156){return _0x862156['destroy']()[_0x918b('0x23')](function(){var _0x175176=_0x862156[_0x918b('0x24')]({'plain':!![]});var _0x349ba0='CmContactHasItems';return db[_0x918b('0x25')][_0x918b('0x26')]({'where':{'type':_0x349ba0,'resourceId':_0x175176['id']}})[_0x918b('0x23')](function(){return _0x862156;});})[_0x918b('0x23')](function(){_0x249f09[_0x918b('0x18')](0xcc)[_0x918b('0x19')]();});}};}function handleEntityNotFound(_0x15521d,_0x460d06){return function(_0x18bdb2){if(!_0x18bdb2){_0x15521d[_0x918b('0x17')](0x194);}return _0x18bdb2;};}function handleError(_0x2064d8,_0x16136e){_0x16136e=_0x16136e||0x1f4;return function(_0x4557cf){logger['error'](_0x4557cf[_0x918b('0x27')]);if(_0x4557cf[_0x918b('0x28')]){delete _0x4557cf[_0x918b('0x28')];}_0x2064d8[_0x918b('0x18')](_0x16136e)[_0x918b('0x29')](_0x4557cf);};}exports['index']=function(_0x58e325,_0x47bbd4){var _0x34369a={},_0x277118={},_0x49e658={'count':0x0,'rows':[]};var _0x4a092e=_[_0x918b('0x2a')](db[_0x918b('0x2b')][_0x918b('0x2c')],function(_0x14c2de){return{'name':_0x14c2de[_0x918b('0x2d')],'type':_0x14c2de[_0x918b('0x2e')]['key']};});_0x277118['model']=_[_0x918b('0x2a')](_0x4a092e,_0x918b('0x28'));_0x277118['query']=_[_0x918b('0x2f')](_0x58e325[_0x918b('0x30')]);_0x277118[_0x918b('0x31')]=_[_0x918b('0x32')](_0x277118['model'],_0x277118[_0x918b('0x30')]);_0x34369a['attributes']=_[_0x918b('0x32')](_0x277118['model'],qs[_0x918b('0x33')](_0x58e325[_0x918b('0x30')][_0x918b('0x33')]));_0x34369a[_0x918b('0x34')]=_0x34369a['attributes'][_0x918b('0x35')]?_0x34369a[_0x918b('0x34')]:_0x277118[_0x918b('0x36')];if(!_0x58e325[_0x918b('0x30')][_0x918b('0x37')](_0x918b('0x38'))){_0x34369a[_0x918b('0x1c')]=qs[_0x918b('0x1c')](_0x58e325[_0x918b('0x30')][_0x918b('0x1c')]);_0x34369a['offset']=qs[_0x918b('0x1b')](_0x58e325[_0x918b('0x30')][_0x918b('0x1b')]);}_0x34369a['order']=qs[_0x918b('0x39')](_0x58e325[_0x918b('0x30')][_0x918b('0x39')]);_0x34369a['where']=qs['filters'](_[_0x918b('0x3a')](_0x58e325[_0x918b('0x30')],_0x277118[_0x918b('0x31')]),_0x4a092e);if(_0x58e325[_0x918b('0x30')][_0x918b('0x3b')]){_0x34369a[_0x918b('0x3c')]=_[_0x918b('0x3d')](_0x34369a[_0x918b('0x3c')],{'$or':_['map'](_0x4a092e,function(_0x227f3d){if(_0x227f3d[_0x918b('0x2e')]!==_0x918b('0x3e')){var _0x2f43d8={};_0x2f43d8[_0x227f3d[_0x918b('0x28')]]={'$like':'%'+_0x58e325[_0x918b('0x30')][_0x918b('0x3b')]+'%'};return _0x2f43d8;}})});}_0x34369a=_[_0x918b('0x3d')]({},_0x34369a,_0x58e325[_0x918b('0x3f')]);var _0x14fe7f={'where':_0x34369a[_0x918b('0x3c')]};return db[_0x918b('0x2b')][_0x918b('0x1d')](_0x14fe7f)['then'](function(_0xcac232){_0x49e658[_0x918b('0x1d')]=_0xcac232;if(_0x58e325[_0x918b('0x30')][_0x918b('0x40')]){_0x34369a[_0x918b('0x41')]=[{'all':!![]}];}return db[_0x918b('0x2b')][_0x918b('0x42')](_0x34369a);})['then'](function(_0x249455){_0x49e658['rows']=_0x249455;return _0x49e658;})[_0x918b('0x23')](respondWithFilteredResult(_0x47bbd4,_0x34369a))['catch'](handleError(_0x47bbd4,null));};exports[_0x918b('0x43')]=function(_0x296c12,_0x22945e){var _0x39d682={'raw':!![],'where':{'id':_0x296c12[_0x918b('0x44')]['id']}},_0x31566f={};_0x31566f['model']=_['keys'](db[_0x918b('0x2b')][_0x918b('0x2c')]);_0x31566f['query']=_[_0x918b('0x2f')](_0x296c12[_0x918b('0x30')]);_0x31566f[_0x918b('0x31')]=_['intersection'](_0x31566f[_0x918b('0x36')],_0x31566f['query']);_0x39d682[_0x918b('0x34')]=_[_0x918b('0x32')](_0x31566f[_0x918b('0x36')],qs[_0x918b('0x33')](_0x296c12[_0x918b('0x30')]['fields']));_0x39d682[_0x918b('0x34')]=_0x39d682['attributes'][_0x918b('0x35')]?_0x39d682[_0x918b('0x34')]:_0x31566f[_0x918b('0x36')];if(_0x296c12['query'][_0x918b('0x40')]){_0x39d682[_0x918b('0x41')]=[{'all':!![]}];}_0x39d682=_[_0x918b('0x3d')]({},_0x39d682,_0x296c12['options']);return db[_0x918b('0x2b')]['find'](_0x39d682)['then'](handleEntityNotFound(_0x22945e,null))[_0x918b('0x23')](respondWithResult(_0x22945e,null))['catch'](handleError(_0x22945e,null));};exports[_0x918b('0x45')]=function(_0xd69d9,_0x2aa018){return db[_0x918b('0x2b')]['create'](_0xd69d9[_0x918b('0x46')],{})[_0x918b('0x23')](function(_0x4400b5){var _0x4769cb=_0xd69d9[_0x918b('0x47')][_0x918b('0x24')]({'plain':!![]});if(!_0x4769cb)throw new Error(_0x918b('0x48'));if(_0x4769cb['role']===_0x918b('0x47')){var _0x6babca=_0x4400b5[_0x918b('0x24')]({'plain':!![]});var _0x1e7dfd=_0x918b('0x49');return db[_0x918b('0x4a')][_0x918b('0x4b')]({'where':{'name':_0x1e7dfd,'userProfileId':_0x4769cb[_0x918b('0x4c')]},'raw':!![]})['then'](function(_0x422e70){if(_0x422e70&&_0x422e70[_0x918b('0x4d')]===0x0){return db['UserProfileResource'][_0x918b('0x45')]({'name':_0x6babca[_0x918b('0x28')],'resourceId':_0x6babca['id'],'type':_0x422e70['name'],'sectionId':_0x422e70['id']},{})['then'](function(){return _0x4400b5;});}else{return _0x4400b5;}})[_0x918b('0x4e')](function(_0x2a81bc){logger['error'](_0x918b('0x4f'),_0x2a81bc);throw _0x2a81bc;});}return _0x4400b5;})['then'](respondWithResult(_0x2aa018,0xc9))[_0x918b('0x4e')](handleError(_0x2aa018,null));};exports['update']=function(_0x348cff,_0x5930d4){if(_0x348cff['body']['id']){delete _0x348cff[_0x918b('0x46')]['id'];}return db[_0x918b('0x2b')]['find']({'where':{'id':_0x348cff[_0x918b('0x44')]['id']}})[_0x918b('0x23')](handleEntityNotFound(_0x5930d4,null))['then'](saveUpdates(_0x348cff[_0x918b('0x46')],null))[_0x918b('0x23')](respondWithResult(_0x5930d4,null))[_0x918b('0x4e')](handleError(_0x5930d4,null));};exports[_0x918b('0x26')]=function(_0x264d78,_0x243722){return db[_0x918b('0x2b')][_0x918b('0x4b')]({'where':{'id':_0x264d78[_0x918b('0x44')]['id']}})[_0x918b('0x23')](handleEntityNotFound(_0x243722,null))[_0x918b('0x23')](removeEntity(_0x243722,null))[_0x918b('0x4e')](handleError(_0x243722,null));};
\ No newline at end of file
+var _0xa91d=['filters','intersection','fields','attributes','length','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','error','name','index','CmContactHasItem','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0xd9a55e,_0x3841a7){var _0x1345b1=function(_0x47662b){while(--_0x47662b){_0xd9a55e['push'](_0xd9a55e['shift']());}};_0x1345b1(++_0x3841a7);}(_0xa91d,0x69));var _0xda91=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa91d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda91('0x0'));var zipdir=require(_0xda91('0x1'));var jsonpatch=require(_0xda91('0x2'));var rp=require(_0xda91('0x3'));var moment=require(_0xda91('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xda91('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xda91('0x6'));var fs=require('fs');var fs_extra=require(_0xda91('0x7'));var _=require(_0xda91('0x8'));var squel=require('squel');var crypto=require(_0xda91('0x9'));var jsforce=require(_0xda91('0xa'));var deskjs=require(_0xda91('0xb'));var toCsv=require(_0xda91('0xc'));var querystring=require(_0xda91('0xd'));var Papa=require(_0xda91('0xe'));var Redis=require('ioredis');var authService=require(_0xda91('0xf'));var qs=require(_0xda91('0x10'));var as=require(_0xda91('0x11'));var hardwareService=require(_0xda91('0x12'));var logger=require(_0xda91('0x13'))(_0xda91('0x14'));var utils=require('../../config/utils');var config=require(_0xda91('0x15'));var licenseUtil=require(_0xda91('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ff8a8,_0x31b1b8){_0x31b1b8=_0x31b1b8||0xcc;return function(_0x2b3aa9){if(_0x2b3aa9){return _0x3ff8a8[_0xda91('0x17')](_0x31b1b8);}return _0x3ff8a8[_0xda91('0x18')](_0x31b1b8)[_0xda91('0x19')]();};}function respondWithResult(_0x5366fa,_0x1042fb){_0x1042fb=_0x1042fb||0xc8;return function(_0x3b0b1b){if(_0x3b0b1b){return _0x5366fa['status'](_0x1042fb)['json'](_0x3b0b1b);}};}function respondWithFilteredResult(_0x13b811,_0x49f5df){return function(_0x13fc83){if(_0x13fc83){var _0x2490f2=typeof _0x49f5df[_0xda91('0x1a')]===_0xda91('0x1b')&&typeof _0x49f5df['limit']===_0xda91('0x1b');var _0x1a9486=_0x13fc83['count'];var _0x5b7088=_0x2490f2?0x0:_0x49f5df[_0xda91('0x1a')];var _0xc2ae77=_0x2490f2?_0x13fc83[_0xda91('0x1c')]:_0x49f5df['offset']+_0x49f5df[_0xda91('0x1d')];var _0x4b5548;if(_0xc2ae77>=_0x1a9486){_0xc2ae77=_0x1a9486;_0x4b5548=0xc8;}else{_0x4b5548=0xce;}_0x13b811[_0xda91('0x18')](_0x4b5548);return _0x13b811['set'](_0xda91('0x1e'),_0x5b7088+'-'+_0xc2ae77+'/'+_0x1a9486)[_0xda91('0x1f')](_0x13fc83);}return null;};}function patchUpdates(_0x78dd91){return function(_0x5642d4){try{jsonpatch[_0xda91('0x20')](_0x5642d4,_0x78dd91,!![]);}catch(_0x3422f2){return BPromise['reject'](_0x3422f2);}return _0x5642d4[_0xda91('0x21')]();};}function saveUpdates(_0x21783a,_0x181b92){return function(_0x274df5){if(_0x274df5){return _0x274df5[_0xda91('0x22')](_0x21783a)[_0xda91('0x23')](function(_0x315784){return _0x315784;});}return null;};}function removeEntity(_0x58e008,_0x3d2c59){return function(_0x1c3e3f){if(_0x1c3e3f){return _0x1c3e3f[_0xda91('0x24')]()[_0xda91('0x23')](function(){var _0x4899fb=_0x1c3e3f[_0xda91('0x25')]({'plain':!![]});var _0x58e11d='CmContactHasItems';return db[_0xda91('0x26')][_0xda91('0x24')]({'where':{'type':_0x58e11d,'resourceId':_0x4899fb['id']}})[_0xda91('0x23')](function(){return _0x1c3e3f;});})[_0xda91('0x23')](function(){_0x58e008[_0xda91('0x18')](0xcc)[_0xda91('0x19')]();});}};}function handleEntityNotFound(_0x9e8838,_0xabbce6){return function(_0x2fd5a4){if(!_0x2fd5a4){_0x9e8838[_0xda91('0x17')](0x194);}return _0x2fd5a4;};}function handleError(_0x222a24,_0x4e3b54){_0x4e3b54=_0x4e3b54||0x1f4;return function(_0x3ccd14){logger[_0xda91('0x27')](_0x3ccd14['stack']);if(_0x3ccd14[_0xda91('0x28')]){delete _0x3ccd14[_0xda91('0x28')];}_0x222a24[_0xda91('0x18')](_0x4e3b54)['send'](_0x3ccd14);};}exports[_0xda91('0x29')]=function(_0x201224,_0x26f924){var _0x36cea6={},_0x5aa0e2={},_0x86e09f={'count':0x0,'rows':[]};var _0x10142c=_['map'](db[_0xda91('0x2a')][_0xda91('0x2b')],function(_0x55ef8a){return{'name':_0x55ef8a[_0xda91('0x2c')],'type':_0x55ef8a[_0xda91('0x2d')][_0xda91('0x2e')]};});_0x5aa0e2[_0xda91('0x2f')]=_[_0xda91('0x30')](_0x10142c,_0xda91('0x28'));_0x5aa0e2[_0xda91('0x31')]=_[_0xda91('0x32')](_0x201224[_0xda91('0x31')]);_0x5aa0e2[_0xda91('0x33')]=_[_0xda91('0x34')](_0x5aa0e2[_0xda91('0x2f')],_0x5aa0e2[_0xda91('0x31')]);_0x36cea6['attributes']=_[_0xda91('0x34')](_0x5aa0e2[_0xda91('0x2f')],qs[_0xda91('0x35')](_0x201224[_0xda91('0x31')][_0xda91('0x35')]));_0x36cea6[_0xda91('0x36')]=_0x36cea6[_0xda91('0x36')][_0xda91('0x37')]?_0x36cea6[_0xda91('0x36')]:_0x5aa0e2['model'];if(!_0x201224[_0xda91('0x31')]['hasOwnProperty']('nolimit')){_0x36cea6[_0xda91('0x1d')]=qs[_0xda91('0x1d')](_0x201224['query'][_0xda91('0x1d')]);_0x36cea6[_0xda91('0x1a')]=qs[_0xda91('0x1a')](_0x201224[_0xda91('0x31')][_0xda91('0x1a')]);}_0x36cea6['order']=qs[_0xda91('0x38')](_0x201224[_0xda91('0x31')][_0xda91('0x38')]);_0x36cea6['where']=qs[_0xda91('0x33')](_['pick'](_0x201224[_0xda91('0x31')],_0x5aa0e2[_0xda91('0x33')]),_0x10142c);if(_0x201224[_0xda91('0x31')][_0xda91('0x39')]){_0x36cea6[_0xda91('0x3a')]=_[_0xda91('0x3b')](_0x36cea6[_0xda91('0x3a')],{'$or':_[_0xda91('0x30')](_0x10142c,function(_0xf3e026){if(_0xf3e026[_0xda91('0x2d')]!=='VIRTUAL'){var _0x35595e={};_0x35595e[_0xf3e026[_0xda91('0x28')]]={'$like':'%'+_0x201224[_0xda91('0x31')][_0xda91('0x39')]+'%'};return _0x35595e;}})});}_0x36cea6=_[_0xda91('0x3b')]({},_0x36cea6,_0x201224[_0xda91('0x3c')]);var _0x1d3b6f={'where':_0x36cea6[_0xda91('0x3a')]};return db[_0xda91('0x2a')][_0xda91('0x1c')](_0x1d3b6f)[_0xda91('0x23')](function(_0x49fe37){_0x86e09f['count']=_0x49fe37;if(_0x201224['query'][_0xda91('0x3d')]){_0x36cea6[_0xda91('0x3e')]=[{'all':!![]}];}return db['CmContactHasItem'][_0xda91('0x3f')](_0x36cea6);})[_0xda91('0x23')](function(_0xd491fe){_0x86e09f[_0xda91('0x40')]=_0xd491fe;return _0x86e09f;})[_0xda91('0x23')](respondWithFilteredResult(_0x26f924,_0x36cea6))[_0xda91('0x41')](handleError(_0x26f924,null));};exports['show']=function(_0x3410c4,_0x22d8de){var _0x3063ed={'raw':!![],'where':{'id':_0x3410c4['params']['id']}},_0x1fe39c={};_0x1fe39c['model']=_[_0xda91('0x32')](db[_0xda91('0x2a')]['rawAttributes']);_0x1fe39c[_0xda91('0x31')]=_[_0xda91('0x32')](_0x3410c4[_0xda91('0x31')]);_0x1fe39c[_0xda91('0x33')]=_[_0xda91('0x34')](_0x1fe39c[_0xda91('0x2f')],_0x1fe39c['query']);_0x3063ed[_0xda91('0x36')]=_[_0xda91('0x34')](_0x1fe39c[_0xda91('0x2f')],qs[_0xda91('0x35')](_0x3410c4[_0xda91('0x31')]['fields']));_0x3063ed['attributes']=_0x3063ed[_0xda91('0x36')][_0xda91('0x37')]?_0x3063ed[_0xda91('0x36')]:_0x1fe39c[_0xda91('0x2f')];if(_0x3410c4[_0xda91('0x31')][_0xda91('0x3d')]){_0x3063ed[_0xda91('0x3e')]=[{'all':!![]}];}_0x3063ed=_[_0xda91('0x3b')]({},_0x3063ed,_0x3410c4[_0xda91('0x3c')]);return db['CmContactHasItem'][_0xda91('0x42')](_0x3063ed)[_0xda91('0x23')](handleEntityNotFound(_0x22d8de,null))[_0xda91('0x23')](respondWithResult(_0x22d8de,null))[_0xda91('0x41')](handleError(_0x22d8de,null));};exports[_0xda91('0x43')]=function(_0xfad63d,_0x2ec88f){return db[_0xda91('0x2a')]['create'](_0xfad63d[_0xda91('0x44')],{})[_0xda91('0x23')](function(_0x5c24fe){var _0x48ae8f=_0xfad63d[_0xda91('0x45')][_0xda91('0x25')]({'plain':!![]});if(!_0x48ae8f)throw new Error(_0xda91('0x46'));if(_0x48ae8f[_0xda91('0x47')]===_0xda91('0x45')){var _0x18d7a8=_0x5c24fe['get']({'plain':!![]});var _0x23fbf3=_0xda91('0x48');return db[_0xda91('0x49')][_0xda91('0x42')]({'where':{'name':_0x23fbf3,'userProfileId':_0x48ae8f[_0xda91('0x4a')]},'raw':!![]})[_0xda91('0x23')](function(_0x5c5f7f){if(_0x5c5f7f&&_0x5c5f7f[_0xda91('0x4b')]===0x0){return db['UserProfileResource'][_0xda91('0x43')]({'name':_0x18d7a8[_0xda91('0x28')],'resourceId':_0x18d7a8['id'],'type':_0x5c5f7f[_0xda91('0x28')],'sectionId':_0x5c5f7f['id']},{})[_0xda91('0x23')](function(){return _0x5c24fe;});}else{return _0x5c24fe;}})[_0xda91('0x41')](function(_0x3f3eb4){logger[_0xda91('0x27')](_0xda91('0x4c'),_0x3f3eb4);throw _0x3f3eb4;});}return _0x5c24fe;})[_0xda91('0x23')](respondWithResult(_0x2ec88f,0xc9))[_0xda91('0x41')](handleError(_0x2ec88f,null));};exports[_0xda91('0x22')]=function(_0x11aad8,_0x32bdcd){if(_0x11aad8[_0xda91('0x44')]['id']){delete _0x11aad8[_0xda91('0x44')]['id'];}return db[_0xda91('0x2a')][_0xda91('0x42')]({'where':{'id':_0x11aad8[_0xda91('0x4d')]['id']}})[_0xda91('0x23')](handleEntityNotFound(_0x32bdcd,null))[_0xda91('0x23')](saveUpdates(_0x11aad8[_0xda91('0x44')],null))['then'](respondWithResult(_0x32bdcd,null))[_0xda91('0x41')](handleError(_0x32bdcd,null));};exports[_0xda91('0x24')]=function(_0x4f8860,_0x478e71){return db[_0xda91('0x2a')][_0xda91('0x42')]({'where':{'id':_0x4f8860['params']['id']}})[_0xda91('0x23')](handleEntityNotFound(_0x478e71,null))[_0xda91('0x23')](removeEntity(_0x478e71,null))[_0xda91('0x41')](handleError(_0x478e71,null));};
\ No newline at end of file