Built motion from commit bbec7235.|2.6.20
[motion2.git] / server / api / cmCustomField / cmCustomField.controller.js
index 4d84320..d1d79c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b88=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','key','differenceBy','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','params','keys','find','catch','body','sequelize','create','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1e7ebe,_0x25b41e){var _0x1aea69=function(_0x3adc9e){while(--_0x3adc9e){_0x1e7ebe['push'](_0x1e7ebe['shift']());}};_0x1aea69(++_0x25b41e);}(_0x7b88,0x1ed));var _0x87b8=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x7b88[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0x87b8('0x0'));var rimraf=require(_0x87b8('0x1'));var zipdir=require(_0x87b8('0x2'));var jsonpatch=require(_0x87b8('0x3'));var rp=require(_0x87b8('0x4'));var moment=require(_0x87b8('0x5'));var BPromise=require(_0x87b8('0x6'));var Mustache=require('mustache');var util=require(_0x87b8('0x7'));var path=require(_0x87b8('0x8'));var sox=require(_0x87b8('0x9'));var csv=require(_0x87b8('0xa'));var ejs=require(_0x87b8('0xb'));var fs=require('fs');var fs_extra=require(_0x87b8('0xc'));var _=require(_0x87b8('0xd'));var squel=require(_0x87b8('0xe'));var crypto=require(_0x87b8('0xf'));var jsforce=require(_0x87b8('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x87b8('0x11'));var Papa=require('papaparse');var Redis=require(_0x87b8('0x12'));var authService=require(_0x87b8('0x13'));var qs=require(_0x87b8('0x14'));var as=require(_0x87b8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x87b8('0x16'));var licenseUtil=require(_0x87b8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x89ca5c,_0x146981){_0x146981=_0x146981||0xcc;return function(_0x21f22e){if(_0x21f22e){return _0x89ca5c[_0x87b8('0x18')](_0x146981);}return _0x89ca5c[_0x87b8('0x19')](_0x146981)[_0x87b8('0x1a')]();};}function respondWithResult(_0x472789,_0x139556){_0x139556=_0x139556||0xc8;return function(_0x1e5585){if(_0x1e5585){return _0x472789[_0x87b8('0x19')](_0x139556)['json'](_0x1e5585);}};}function respondWithFilteredResult(_0x13061d,_0x3787c4){return function(_0x59e706){if(_0x59e706){var _0x35d453=typeof _0x3787c4['offset']===_0x87b8('0x1b')&&typeof _0x3787c4[_0x87b8('0x1c')]===_0x87b8('0x1b');var _0x3c375a=_0x59e706[_0x87b8('0x1d')];var _0x5b1820=_0x35d453?0x0:_0x3787c4[_0x87b8('0x1e')];var _0x4f0339=_0x35d453?_0x59e706[_0x87b8('0x1d')]:_0x3787c4[_0x87b8('0x1e')]+_0x3787c4[_0x87b8('0x1c')];var _0x18b5a7;if(_0x4f0339>=_0x3c375a){_0x4f0339=_0x3c375a;_0x18b5a7=0xc8;}else{_0x18b5a7=0xce;}_0x13061d[_0x87b8('0x19')](_0x18b5a7);return _0x13061d[_0x87b8('0x1f')](_0x87b8('0x20'),_0x5b1820+'-'+_0x4f0339+'/'+_0x3c375a)[_0x87b8('0x21')](_0x59e706);}return null;};}function patchUpdates(_0x325ac0){return function(_0x562afe){try{jsonpatch[_0x87b8('0x22')](_0x562afe,_0x325ac0,!![]);}catch(_0x1d00fb){return BPromise['reject'](_0x1d00fb);}return _0x562afe[_0x87b8('0x23')]();};}function saveUpdates(_0xa271e9,_0x3d192c){return function(_0x3262fc){if(_0x3262fc){return _0x3262fc[_0x87b8('0x24')](_0xa271e9)['then'](function(_0x2a5eb6){return _0x2a5eb6;});}return null;};}function removeEntity(_0x5d5620,_0x1f40b9){return function(_0x41a6bb){if(_0x41a6bb){return _0x41a6bb[_0x87b8('0x25')]()[_0x87b8('0x26')](function(){_0x5d5620['status'](0xcc)[_0x87b8('0x1a')]();});}};}function handleEntityNotFound(_0x243883,_0x226e1e){return function(_0xa667d9){if(!_0xa667d9){_0x243883['sendStatus'](0x194);}return _0xa667d9;};}function handleError(_0x46c4ae,_0x39554c){_0x39554c=_0x39554c||0x1f4;return function(_0x2fc99e){logger[_0x87b8('0x27')](_0x2fc99e[_0x87b8('0x28')]);if(_0x2fc99e[_0x87b8('0x29')]){delete _0x2fc99e['name'];}_0x46c4ae[_0x87b8('0x19')](_0x39554c)[_0x87b8('0x2a')](_0x2fc99e);};}exports[_0x87b8('0x2b')]=function(_0x1dda34,_0x133205){var _0x26d5db={},_0x38d2f2={},_0x3cabbe={'count':0x0,'rows':[]};var _0x5df39b=_[_0x87b8('0x2c')](db[_0x87b8('0x2d')][_0x87b8('0x2e')],function(_0x27e05a){return{'name':_0x27e05a['fieldName'],'type':_0x27e05a['type'][_0x87b8('0x2f')]};});_0x38d2f2['model']=_[_0x87b8('0x30')](_[_0x87b8('0x2c')](_0x5df39b,_0x87b8('0x29')),[_0x87b8('0x29')]);_0x38d2f2[_0x87b8('0x31')]=_['keys'](_0x1dda34['query']);_0x38d2f2[_0x87b8('0x32')]=_[_0x87b8('0x33')](_0x38d2f2[_0x87b8('0x34')],_0x38d2f2[_0x87b8('0x31')]);_0x26d5db[_0x87b8('0x35')]=_[_0x87b8('0x33')](_0x38d2f2['model'],qs[_0x87b8('0x36')](_0x1dda34[_0x87b8('0x31')]['fields']));_0x26d5db[_0x87b8('0x35')]=_0x26d5db[_0x87b8('0x35')][_0x87b8('0x37')]?_0x26d5db[_0x87b8('0x35')]:_0x38d2f2[_0x87b8('0x34')];if(!_0x1dda34[_0x87b8('0x31')][_0x87b8('0x38')]('nolimit')){_0x26d5db[_0x87b8('0x1c')]=qs[_0x87b8('0x1c')](_0x1dda34['query'][_0x87b8('0x1c')]);_0x26d5db['offset']=qs[_0x87b8('0x1e')](_0x1dda34[_0x87b8('0x31')][_0x87b8('0x1e')]);}_0x26d5db['order']=qs[_0x87b8('0x39')](_0x1dda34[_0x87b8('0x31')][_0x87b8('0x39')]);_0x26d5db[_0x87b8('0x3a')]=qs['filters'](_['pick'](_0x1dda34[_0x87b8('0x31')],_0x38d2f2[_0x87b8('0x32')]),_0x5df39b);if(_0x1dda34['query'][_0x87b8('0x3b')]){_0x26d5db[_0x87b8('0x3a')]=_[_0x87b8('0x3c')](_0x26d5db[_0x87b8('0x3a')],{'$or':_[_0x87b8('0x2c')](_0x5df39b,function(_0x36969f){if(_0x36969f[_0x87b8('0x3d')]!==_0x87b8('0x3e')){var _0xcae14={};_0xcae14[_0x36969f[_0x87b8('0x29')]]={'$like':'%'+_0x1dda34['query']['filter']+'%'};return _0xcae14;}})});}_0x26d5db=_[_0x87b8('0x3c')]({},_0x26d5db,_0x1dda34[_0x87b8('0x3f')]);var _0x364a70={'where':_0x26d5db[_0x87b8('0x3a')]};return db['CmCustomField'][_0x87b8('0x1d')](_0x364a70)[_0x87b8('0x26')](function(_0x5e2598){_0x3cabbe[_0x87b8('0x1d')]=_0x5e2598;if(_0x1dda34[_0x87b8('0x31')][_0x87b8('0x40')]){_0x26d5db['include']=[{'all':!![]}];}return db[_0x87b8('0x2d')][_0x87b8('0x41')](_0x26d5db);})['then'](function(_0x50dfc1){_0x3cabbe['rows']=_0x50dfc1;return _0x3cabbe;})['then'](respondWithFilteredResult(_0x133205,_0x26d5db))['catch'](handleError(_0x133205,null));};exports['show']=function(_0xbc4446,_0x61c206){var _0x2d1468={'raw':!![],'where':{'id':_0xbc4446[_0x87b8('0x42')]['id']}},_0x112b5f={};_0x112b5f['model']=_['keys'](db['CmCustomField'][_0x87b8('0x2e')]);_0x112b5f[_0x87b8('0x31')]=_[_0x87b8('0x43')](_0xbc4446['query']);_0x112b5f[_0x87b8('0x32')]=_[_0x87b8('0x33')](_0x112b5f[_0x87b8('0x34')],_0x112b5f[_0x87b8('0x31')]);_0x2d1468[_0x87b8('0x35')]=_[_0x87b8('0x33')](_0x112b5f['model'],qs[_0x87b8('0x36')](_0xbc4446[_0x87b8('0x31')][_0x87b8('0x36')]));_0x2d1468[_0x87b8('0x35')]=_0x2d1468[_0x87b8('0x35')][_0x87b8('0x37')]?_0x2d1468[_0x87b8('0x35')]:_0x112b5f[_0x87b8('0x34')];if(_0xbc4446[_0x87b8('0x31')][_0x87b8('0x40')]){_0x2d1468['include']=[{'all':!![]}];}_0x2d1468=_[_0x87b8('0x3c')]({},_0x2d1468,_0xbc4446[_0x87b8('0x3f')]);return db[_0x87b8('0x2d')][_0x87b8('0x44')](_0x2d1468)[_0x87b8('0x26')](handleEntityNotFound(_0x61c206,null))['then'](respondWithResult(_0x61c206,null))[_0x87b8('0x45')](handleError(_0x61c206,null));};exports[_0x87b8('0x24')]=function(_0x5e8357,_0x5130d7){if(_0x5e8357[_0x87b8('0x46')]['id']){delete _0x5e8357[_0x87b8('0x46')]['id'];}return db[_0x87b8('0x2d')]['find']({'where':{'id':_0x5e8357['params']['id']}})['then'](handleEntityNotFound(_0x5130d7,null))[_0x87b8('0x26')](saveUpdates(_0x5e8357[_0x87b8('0x46')],null))[_0x87b8('0x26')](respondWithResult(_0x5130d7,null))[_0x87b8('0x45')](handleError(_0x5130d7,null));};exports[_0x87b8('0x25')]=function(_0x407557,_0x456e8a){return db[_0x87b8('0x2d')][_0x87b8('0x44')]({'where':{'id':_0x407557[_0x87b8('0x42')]['id']}})['then'](handleEntityNotFound(_0x456e8a,null))[_0x87b8('0x26')](removeEntity(_0x456e8a,null))[_0x87b8('0x45')](handleError(_0x456e8a,null));};exports['create']=function(_0x25b179,_0x5806dc){var _0x25cd1a;return db[_0x87b8('0x47')]['transaction'](function(_0x56a18c){return db['CmCustomField'][_0x87b8('0x48')](_0x25b179['body'],{'transaction':_0x56a18c})[_0x87b8('0x26')](function(_0x9ae3a){_0x25cd1a=_0x9ae3a;var _0x2eb09c={'type':db[_0x87b8('0x49')][_0x87b8('0x4a')],'transaction':_0x56a18c};switch(_0x25b179[_0x87b8('0x46')][_0x87b8('0x3d')]){case _0x87b8('0x4b'):_0x2eb09c[_0x87b8('0x3d')]=db['Sequelize'][_0x87b8('0x4a')];break;case'number':_0x2eb09c[_0x87b8('0x3d')]=db[_0x87b8('0x49')][_0x87b8('0x4c')];break;case _0x87b8('0x4d'):_0x2eb09c[_0x87b8('0x3d')]=db['Sequelize'][_0x87b8('0x4e')];_0x2eb09c[_0x87b8('0x4f')]=![];break;default:}return db[_0x87b8('0x47')][_0x87b8('0x50')][_0x87b8('0x51')](_0x87b8('0x52'),util[_0x87b8('0x53')](_0x87b8('0x54'),_0x25cd1a['id']),_0x2eb09c);})[_0x87b8('0x26')](function(){return _0x25cd1a;});})[_0x87b8('0x26')](respondWithResult(_0x5806dc,0xc9))[_0x87b8('0x45')](handleError(_0x5806dc,null));};
\ No newline at end of file
+var _0xcb1f=['moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','CmCustomField','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','update','body','find','create','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cf_%d','eml-format','zip-dir','fast-json-patch'];(function(_0x363bc7,_0x18f9f6){var _0x2a43c4=function(_0x2688dd){while(--_0x2688dd){_0x363bc7['push'](_0x363bc7['shift']());}};_0x2a43c4(++_0x18f9f6);}(_0xcb1f,0xb1));var _0xfcb1=function(_0x7d0afa,_0x25ede4){_0x7d0afa=_0x7d0afa-0x0;var _0x124bfd=_0xcb1f[_0x7d0afa];return _0x124bfd;};'use strict';var emlformat=require(_0xfcb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfcb1('0x1'));var jsonpatch=require(_0xfcb1('0x2'));var rp=require('request-promise');var moment=require(_0xfcb1('0x3'));var BPromise=require(_0xfcb1('0x4'));var Mustache=require(_0xfcb1('0x5'));var util=require(_0xfcb1('0x6'));var path=require(_0xfcb1('0x7'));var sox=require('sox');var csv=require(_0xfcb1('0x8'));var ejs=require(_0xfcb1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcb1('0xa'));var squel=require(_0xfcb1('0xb'));var crypto=require(_0xfcb1('0xc'));var jsforce=require(_0xfcb1('0xd'));var deskjs=require(_0xfcb1('0xe'));var toCsv=require(_0xfcb1('0x8'));var querystring=require(_0xfcb1('0xf'));var Papa=require(_0xfcb1('0x10'));var Redis=require(_0xfcb1('0x11'));var authService=require(_0xfcb1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfcb1('0x13'));var hardwareService=require(_0xfcb1('0x14'));var logger=require(_0xfcb1('0x15'))(_0xfcb1('0x16'));var utils=require(_0xfcb1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfcb1('0x18'));var db=require(_0xfcb1('0x19'))['db'];function respondWithStatusCode(_0x401cfb,_0x12d82c){_0x12d82c=_0x12d82c||0xcc;return function(_0x9932e3){if(_0x9932e3){return _0x401cfb['sendStatus'](_0x12d82c);}return _0x401cfb[_0xfcb1('0x1a')](_0x12d82c)[_0xfcb1('0x1b')]();};}function respondWithResult(_0x18f3e8,_0x3c9fb0){_0x3c9fb0=_0x3c9fb0||0xc8;return function(_0x5626f1){if(_0x5626f1){return _0x18f3e8['status'](_0x3c9fb0)[_0xfcb1('0x1c')](_0x5626f1);}};}function respondWithFilteredResult(_0x4de4cb,_0x2efd7c){return function(_0x124dc5){if(_0x124dc5){var _0x4bf3d9=typeof _0x2efd7c[_0xfcb1('0x1d')]===_0xfcb1('0x1e')&&typeof _0x2efd7c[_0xfcb1('0x1f')]===_0xfcb1('0x1e');var _0x44012e=_0x124dc5['count'];var _0x48e14a=_0x4bf3d9?0x0:_0x2efd7c['offset'];var _0x378f9c=_0x4bf3d9?_0x124dc5[_0xfcb1('0x20')]:_0x2efd7c[_0xfcb1('0x1d')]+_0x2efd7c[_0xfcb1('0x1f')];var _0x521f65;if(_0x378f9c>=_0x44012e){_0x378f9c=_0x44012e;_0x521f65=0xc8;}else{_0x521f65=0xce;}_0x4de4cb[_0xfcb1('0x1a')](_0x521f65);return _0x4de4cb[_0xfcb1('0x21')]('Content-Range',_0x48e14a+'-'+_0x378f9c+'/'+_0x44012e)['json'](_0x124dc5);}return null;};}function patchUpdates(_0x56471f){return function(_0x24438b){try{jsonpatch['apply'](_0x24438b,_0x56471f,!![]);}catch(_0x31ba87){return BPromise[_0xfcb1('0x22')](_0x31ba87);}return _0x24438b[_0xfcb1('0x23')]();};}function saveUpdates(_0x5d99ec,_0x2a9c95){return function(_0x1b6472){if(_0x1b6472){return _0x1b6472['update'](_0x5d99ec)[_0xfcb1('0x24')](function(_0x5f2644){return _0x5f2644;});}return null;};}function removeEntity(_0x4881ce,_0x109b33){return function(_0x461f61){if(_0x461f61){return _0x461f61[_0xfcb1('0x25')]()[_0xfcb1('0x24')](function(){_0x4881ce[_0xfcb1('0x1a')](0xcc)[_0xfcb1('0x1b')]();});}};}function handleEntityNotFound(_0x54c6bd,_0x29fb2c){return function(_0x21d705){if(!_0x21d705){_0x54c6bd[_0xfcb1('0x26')](0x194);}return _0x21d705;};}function handleError(_0x3623e0,_0x1a7cb7){_0x1a7cb7=_0x1a7cb7||0x1f4;return function(_0x4f332f){logger[_0xfcb1('0x27')](_0x4f332f[_0xfcb1('0x28')]);if(_0x4f332f['name']){delete _0x4f332f[_0xfcb1('0x29')];}_0x3623e0['status'](_0x1a7cb7)[_0xfcb1('0x2a')](_0x4f332f);};}exports[_0xfcb1('0x2b')]=function(_0x516969,_0x1d2f09){var _0x52fff0={},_0xff4f9f={},_0x222242={'count':0x0,'rows':[]};var _0x15360a=_[_0xfcb1('0x2c')](db[_0xfcb1('0x2d')]['rawAttributes'],function(_0x410723){return{'name':_0x410723[_0xfcb1('0x2e')],'type':_0x410723[_0xfcb1('0x2f')][_0xfcb1('0x30')]};});_0xff4f9f[_0xfcb1('0x31')]=_[_0xfcb1('0x32')](_[_0xfcb1('0x2c')](_0x15360a,_0xfcb1('0x29')),[_0xfcb1('0x29')]);_0xff4f9f['query']=_[_0xfcb1('0x33')](_0x516969[_0xfcb1('0x34')]);_0xff4f9f[_0xfcb1('0x35')]=_['intersection'](_0xff4f9f[_0xfcb1('0x31')],_0xff4f9f[_0xfcb1('0x34')]);_0x52fff0['attributes']=_[_0xfcb1('0x36')](_0xff4f9f['model'],qs[_0xfcb1('0x37')](_0x516969[_0xfcb1('0x34')][_0xfcb1('0x37')]));_0x52fff0[_0xfcb1('0x38')]=_0x52fff0[_0xfcb1('0x38')][_0xfcb1('0x39')]?_0x52fff0[_0xfcb1('0x38')]:_0xff4f9f[_0xfcb1('0x31')];if(!_0x516969[_0xfcb1('0x34')][_0xfcb1('0x3a')](_0xfcb1('0x3b'))){_0x52fff0[_0xfcb1('0x1f')]=qs[_0xfcb1('0x1f')](_0x516969[_0xfcb1('0x34')][_0xfcb1('0x1f')]);_0x52fff0[_0xfcb1('0x1d')]=qs[_0xfcb1('0x1d')](_0x516969['query'][_0xfcb1('0x1d')]);}_0x52fff0[_0xfcb1('0x3c')]=qs[_0xfcb1('0x3d')](_0x516969[_0xfcb1('0x34')]['sort']);_0x52fff0[_0xfcb1('0x3e')]=qs['filters'](_[_0xfcb1('0x3f')](_0x516969[_0xfcb1('0x34')],_0xff4f9f[_0xfcb1('0x35')]),_0x15360a);if(_0x516969[_0xfcb1('0x34')][_0xfcb1('0x40')]){_0x52fff0['where']=_[_0xfcb1('0x41')](_0x52fff0[_0xfcb1('0x3e')],{'$or':_['map'](_0x15360a,function(_0x1bd5c9){if(_0x1bd5c9[_0xfcb1('0x2f')]!=='VIRTUAL'){var _0x4a020b={};_0x4a020b[_0x1bd5c9[_0xfcb1('0x29')]]={'$like':'%'+_0x516969['query']['filter']+'%'};return _0x4a020b;}})});}_0x52fff0=_[_0xfcb1('0x41')]({},_0x52fff0,_0x516969[_0xfcb1('0x42')]);var _0x185b01={'where':_0x52fff0['where']};return db[_0xfcb1('0x2d')][_0xfcb1('0x20')](_0x185b01)[_0xfcb1('0x24')](function(_0x11254c){_0x222242['count']=_0x11254c;if(_0x516969[_0xfcb1('0x34')][_0xfcb1('0x43')]){_0x52fff0[_0xfcb1('0x44')]=[{'all':!![]}];}return db[_0xfcb1('0x2d')][_0xfcb1('0x45')](_0x52fff0);})[_0xfcb1('0x24')](function(_0x32174c){_0x222242['rows']=_0x32174c;return _0x222242;})['then'](respondWithFilteredResult(_0x1d2f09,_0x52fff0))[_0xfcb1('0x46')](handleError(_0x1d2f09,null));};exports[_0xfcb1('0x47')]=function(_0x4eb942,_0x4d595e){var _0x1850d2={'raw':!![],'where':{'id':_0x4eb942[_0xfcb1('0x48')]['id']}},_0x39220e={};_0x39220e[_0xfcb1('0x31')]=_['keys'](db['CmCustomField'][_0xfcb1('0x49')]);_0x39220e['query']=_['keys'](_0x4eb942[_0xfcb1('0x34')]);_0x39220e[_0xfcb1('0x35')]=_[_0xfcb1('0x36')](_0x39220e['model'],_0x39220e[_0xfcb1('0x34')]);_0x1850d2[_0xfcb1('0x38')]=_[_0xfcb1('0x36')](_0x39220e['model'],qs['fields'](_0x4eb942[_0xfcb1('0x34')][_0xfcb1('0x37')]));_0x1850d2[_0xfcb1('0x38')]=_0x1850d2[_0xfcb1('0x38')][_0xfcb1('0x39')]?_0x1850d2[_0xfcb1('0x38')]:_0x39220e[_0xfcb1('0x31')];if(_0x4eb942['query'][_0xfcb1('0x43')]){_0x1850d2[_0xfcb1('0x44')]=[{'all':!![]}];}_0x1850d2=_['merge']({},_0x1850d2,_0x4eb942[_0xfcb1('0x42')]);return db[_0xfcb1('0x2d')]['find'](_0x1850d2)['then'](handleEntityNotFound(_0x4d595e,null))[_0xfcb1('0x24')](respondWithResult(_0x4d595e,null))[_0xfcb1('0x46')](handleError(_0x4d595e,null));};exports[_0xfcb1('0x4a')]=function(_0x1edb30,_0x9f477e){if(_0x1edb30['body']['id']){delete _0x1edb30[_0xfcb1('0x4b')]['id'];}return db['CmCustomField'][_0xfcb1('0x4c')]({'where':{'id':_0x1edb30['params']['id']}})[_0xfcb1('0x24')](handleEntityNotFound(_0x9f477e,null))[_0xfcb1('0x24')](saveUpdates(_0x1edb30['body'],null))['then'](respondWithResult(_0x9f477e,null))[_0xfcb1('0x46')](handleError(_0x9f477e,null));};exports[_0xfcb1('0x25')]=function(_0x8907dc,_0x200bc5){return db['CmCustomField'][_0xfcb1('0x4c')]({'where':{'id':_0x8907dc['params']['id']}})[_0xfcb1('0x24')](handleEntityNotFound(_0x200bc5,null))['then'](removeEntity(_0x200bc5,null))[_0xfcb1('0x46')](handleError(_0x200bc5,null));};exports[_0xfcb1('0x4d')]=function(_0x35fff9,_0x511a9f){var _0x48c43f;return db[_0xfcb1('0x4e')][_0xfcb1('0x4f')](function(_0x4408f7){return db[_0xfcb1('0x2d')][_0xfcb1('0x4d')](_0x35fff9[_0xfcb1('0x4b')],{'transaction':_0x4408f7})[_0xfcb1('0x24')](function(_0x218d98){_0x48c43f=_0x218d98;var _0x45ebdc={'type':db[_0xfcb1('0x50')]['TEXT'],'transaction':_0x4408f7};switch(_0x35fff9['body'][_0xfcb1('0x2f')]){case _0xfcb1('0x51'):_0x45ebdc[_0xfcb1('0x2f')]=db['Sequelize'][_0xfcb1('0x52')];break;case _0xfcb1('0x53'):_0x45ebdc[_0xfcb1('0x2f')]=db['Sequelize'][_0xfcb1('0x54')];break;case _0xfcb1('0x55'):_0x45ebdc['type']=db[_0xfcb1('0x50')][_0xfcb1('0x56')];_0x45ebdc[_0xfcb1('0x57')]=![];break;default:}return db['sequelize']['queryInterface'][_0xfcb1('0x58')]('cm_contacts',util['format'](_0xfcb1('0x59'),_0x48c43f['id']),_0x45ebdc);})[_0xfcb1('0x24')](function(){return _0x48c43f;});})['then'](respondWithResult(_0x511a9f,0xc9))['catch'](handleError(_0x511a9f,null));};
\ No newline at end of file