Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / api / cmCustomField / cmCustomField.controller.js
index 7e9afbc..2a903a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0ea=['limit','set','Content-Range','apply','update','then','destroy','error','name','send','index','fieldName','key','differenceBy','map','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','CmCustomField','count','findAll','rows','catch','rawAttributes','include','body','find','params','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','format','cf_%d','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc0ea,0x8f));var _0xac0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0ea[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xac0e('0x0'));var emlformat=require(_0xac0e('0x1'));var rimraf=require(_0xac0e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac0e('0x3'));var rp=require('request-promise');var moment=require(_0xac0e('0x4'));var BPromise=require(_0xac0e('0x5'));var Mustache=require(_0xac0e('0x6'));var util=require(_0xac0e('0x7'));var path=require(_0xac0e('0x8'));var sox=require(_0xac0e('0x9'));var csv=require(_0xac0e('0xa'));var ejs=require(_0xac0e('0xb'));var fs=require('fs');var _=require(_0xac0e('0xc'));var squel=require('squel');var crypto=require(_0xac0e('0xd'));var jsforce=require(_0xac0e('0xe'));var deskjs=require(_0xac0e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xac0e('0x10'));var Papa=require(_0xac0e('0x11'));var Redis=require(_0xac0e('0x12'));var authService=require(_0xac0e('0x13'));var qs=require(_0xac0e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xac0e('0x15'))(_0xac0e('0x16'));var utils=require(_0xac0e('0x17'));var config=require(_0xac0e('0x18'));var db=require(_0xac0e('0x19'))['db'];function respondWithStatusCode(_0x10df9e,_0x5e96a0){_0x5e96a0=_0x5e96a0||0xcc;return function(_0x3bc3ac){if(_0x3bc3ac){return _0x10df9e[_0xac0e('0x1a')](_0x5e96a0);}return _0x10df9e[_0xac0e('0x1b')](_0x5e96a0)[_0xac0e('0x1c')]();};}function respondWithResult(_0x19686b,_0x22e4b1){_0x22e4b1=_0x22e4b1||0xc8;return function(_0x41b2c7){if(_0x41b2c7){return _0x19686b['status'](_0x22e4b1)[_0xac0e('0x1d')](_0x41b2c7);}};}function respondWithFilteredResult(_0x496c62,_0x3a270e){return function(_0x38fe91){if(_0x38fe91){var _0x51dc81=_0x38fe91['count'],_0x3bea99=_0x3a270e[_0xac0e('0x1e')],_0x44c9a5=_0x3a270e[_0xac0e('0x1e')]+_0x3a270e[_0xac0e('0x1f')],_0x666729;if(_0x44c9a5>=_0x51dc81){_0x44c9a5=_0x51dc81;_0x666729=0xc8;}else{_0x666729=0xce;}_0x496c62[_0xac0e('0x1b')](_0x666729);return _0x496c62[_0xac0e('0x20')](_0xac0e('0x21'),_0x3bea99+'-'+_0x44c9a5+'/'+_0x51dc81)[_0xac0e('0x1d')](_0x38fe91);}return null;};}function patchUpdates(_0x2bbc6c){return function(_0x5b7bfd){try{jsonpatch[_0xac0e('0x22')](_0x5b7bfd,_0x2bbc6c,!![]);}catch(_0x52bb0b){return BPromise['reject'](_0x52bb0b);}return _0x5b7bfd['save']();};}function saveUpdates(_0x27602d,_0x92f4b){return function(_0x1f96ce){if(_0x1f96ce){return _0x1f96ce[_0xac0e('0x23')](_0x27602d)[_0xac0e('0x24')](function(_0x5908b2){return _0x5908b2;});}return null;};}function removeEntity(_0x2aa462,_0x23373c){return function(_0x5778a9){if(_0x5778a9){return _0x5778a9[_0xac0e('0x25')]()[_0xac0e('0x24')](function(){_0x2aa462[_0xac0e('0x1b')](0xcc)[_0xac0e('0x1c')]();});}};}function handleEntityNotFound(_0x3ae41d,_0x5c4781){return function(_0x37e418){if(!_0x37e418){_0x3ae41d[_0xac0e('0x1a')](0x194);}return _0x37e418;};}function handleError(_0x1d2205,_0xe40d35){_0xe40d35=_0xe40d35||0x1f4;return function(_0x3cb090){logger[_0xac0e('0x26')](_0x3cb090['stack']);if(_0x3cb090[_0xac0e('0x27')]){delete _0x3cb090[_0xac0e('0x27')];}_0x1d2205[_0xac0e('0x1b')](_0xe40d35)[_0xac0e('0x28')](_0x3cb090);};}exports[_0xac0e('0x29')]=function(_0x790d24,_0x4936d7){var _0x160a6f={},_0x5a3d74={},_0x330aa6={'count':0x0,'rows':[]};var _0x453240=_['map'](db['CmCustomField']['rawAttributes'],function(_0x5f03ad){return{'name':_0x5f03ad[_0xac0e('0x2a')],'type':_0x5f03ad['type'][_0xac0e('0x2b')]};});_0x5a3d74['model']=_[_0xac0e('0x2c')](_[_0xac0e('0x2d')](_0x453240,'name'),[_0xac0e('0x27')]);_0x5a3d74[_0xac0e('0x2e')]=_[_0xac0e('0x2f')](_0x790d24[_0xac0e('0x2e')]);_0x5a3d74['filters']=_[_0xac0e('0x30')](_0x5a3d74['model'],_0x5a3d74[_0xac0e('0x2e')]);_0x160a6f['attributes']=_['intersection'](_0x5a3d74[_0xac0e('0x31')],qs[_0xac0e('0x32')](_0x790d24[_0xac0e('0x2e')][_0xac0e('0x32')]));_0x160a6f[_0xac0e('0x33')]=_0x160a6f[_0xac0e('0x33')][_0xac0e('0x34')]?_0x160a6f[_0xac0e('0x33')]:_0x5a3d74[_0xac0e('0x31')];if(!_0x790d24[_0xac0e('0x2e')]['hasOwnProperty'](_0xac0e('0x35'))){_0x160a6f[_0xac0e('0x1f')]=qs[_0xac0e('0x1f')](_0x790d24[_0xac0e('0x2e')][_0xac0e('0x1f')]);_0x160a6f[_0xac0e('0x1e')]=qs[_0xac0e('0x1e')](_0x790d24['query']['offset']);}_0x160a6f[_0xac0e('0x36')]=qs[_0xac0e('0x37')](_0x790d24[_0xac0e('0x2e')]['sort']);_0x160a6f[_0xac0e('0x38')]=qs[_0xac0e('0x39')](_[_0xac0e('0x3a')](_0x790d24['query'],_0x5a3d74[_0xac0e('0x39')]));if(_0x790d24[_0xac0e('0x2e')]['filter']){_0x160a6f['where']=_[_0xac0e('0x3b')](_0x160a6f['where'],{'$or':_[_0xac0e('0x2d')](_0x453240,function(_0xdb3116){if(_0xdb3116[_0xac0e('0x3c')]!==_0xac0e('0x3d')){var _0x3711c9={};_0x3711c9[_0xdb3116[_0xac0e('0x27')]]={'$like':'%'+_0x790d24[_0xac0e('0x2e')][_0xac0e('0x3e')]+'%'};return _0x3711c9;}})});}_0x160a6f=_[_0xac0e('0x3b')]({},_0x160a6f,_0x790d24[_0xac0e('0x3f')]);var _0x10c07c={'where':_0x160a6f[_0xac0e('0x38')]};return db[_0xac0e('0x40')][_0xac0e('0x41')](_0x10c07c)[_0xac0e('0x24')](function(_0x5d1b56){_0x330aa6['count']=_0x5d1b56;if(_0x790d24[_0xac0e('0x2e')]['includeAll']){_0x160a6f['include']=[{'all':!![]}];}return db[_0xac0e('0x40')][_0xac0e('0x42')](_0x160a6f);})['then'](function(_0x146186){_0x330aa6[_0xac0e('0x43')]=_0x146186;return _0x330aa6;})['then'](respondWithFilteredResult(_0x4936d7,_0x160a6f))[_0xac0e('0x44')](handleError(_0x4936d7,null));};exports['show']=function(_0x52227f,_0x291883){var _0x3cb54f={'raw':!![],'where':{'id':_0x52227f['params']['id']}},_0x19099e={};_0x19099e['model']=_['keys'](db[_0xac0e('0x40')][_0xac0e('0x45')]);_0x19099e[_0xac0e('0x2e')]=_[_0xac0e('0x2f')](_0x52227f[_0xac0e('0x2e')]);_0x19099e[_0xac0e('0x39')]=_[_0xac0e('0x30')](_0x19099e['model'],_0x19099e[_0xac0e('0x2e')]);_0x3cb54f['attributes']=_[_0xac0e('0x30')](_0x19099e[_0xac0e('0x31')],qs[_0xac0e('0x32')](_0x52227f[_0xac0e('0x2e')][_0xac0e('0x32')]));_0x3cb54f[_0xac0e('0x33')]=_0x3cb54f['attributes'][_0xac0e('0x34')]?_0x3cb54f[_0xac0e('0x33')]:_0x19099e[_0xac0e('0x31')];if(_0x52227f[_0xac0e('0x2e')]['includeAll']){_0x3cb54f[_0xac0e('0x46')]=[{'all':!![]}];}_0x3cb54f=_[_0xac0e('0x3b')]({},_0x3cb54f,_0x52227f[_0xac0e('0x3f')]);return db[_0xac0e('0x40')]['find'](_0x3cb54f)[_0xac0e('0x24')](handleEntityNotFound(_0x291883,null))['then'](respondWithResult(_0x291883,null))[_0xac0e('0x44')](handleError(_0x291883,null));};exports['update']=function(_0x17cac1,_0x1a4246){if(_0x17cac1[_0xac0e('0x47')]['id']){delete _0x17cac1[_0xac0e('0x47')]['id'];}return db['CmCustomField'][_0xac0e('0x48')]({'where':{'id':_0x17cac1[_0xac0e('0x49')]['id']}})[_0xac0e('0x24')](handleEntityNotFound(_0x1a4246,null))[_0xac0e('0x24')](saveUpdates(_0x17cac1['body'],null))[_0xac0e('0x24')](respondWithResult(_0x1a4246,null))[_0xac0e('0x44')](handleError(_0x1a4246,null));};exports['destroy']=function(_0x46af7c,_0x336f8f){return db['CmCustomField'][_0xac0e('0x48')]({'where':{'id':_0x46af7c[_0xac0e('0x49')]['id']}})[_0xac0e('0x24')](handleEntityNotFound(_0x336f8f,null))['then'](removeEntity(_0x336f8f,null))[_0xac0e('0x44')](handleError(_0x336f8f,null));};exports[_0xac0e('0x4a')]=function(_0x1f006a,_0x48d853){var _0x25db2e;return db[_0xac0e('0x4b')][_0xac0e('0x4c')](function(_0x2ceba5){return db[_0xac0e('0x40')][_0xac0e('0x4a')](_0x1f006a['body'],{'transaction':_0x2ceba5})[_0xac0e('0x24')](function(_0x3581fb){_0x25db2e=_0x3581fb;var _0x1e26d8={'type':db[_0xac0e('0x4d')][_0xac0e('0x4e')],'transaction':_0x2ceba5};switch(_0x1f006a[_0xac0e('0x47')][_0xac0e('0x3c')]){case _0xac0e('0x4f'):_0x1e26d8[_0xac0e('0x3c')]=db[_0xac0e('0x4d')][_0xac0e('0x4e')];break;case _0xac0e('0x50'):_0x1e26d8[_0xac0e('0x3c')]=db[_0xac0e('0x4d')][_0xac0e('0x51')];break;case _0xac0e('0x52'):_0x1e26d8['type']=db[_0xac0e('0x4d')][_0xac0e('0x53')];_0x1e26d8[_0xac0e('0x54')]=![];break;default:}return db[_0xac0e('0x4b')]['queryInterface']['addColumn']('cm_contacts',util[_0xac0e('0x55')](_0xac0e('0x56'),_0x25db2e['id']),_0x1e26d8);})['then'](function(){return _0x25db2e;});})[_0xac0e('0x24')](respondWithResult(_0x48d853,0xc9))[_0xac0e('0x44')](handleError(_0x48d853,null));};
\ No newline at end of file
+var _0x7915=['fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','body','find','create','sequelize','transaction','Sequelize','TEXT','text','type','INTEGER','switch','defaultValue','queryInterface','addColumn','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs'];(function(_0x1b8f5a,_0x57c154){var _0x594189=function(_0x15b277){while(--_0x15b277){_0x1b8f5a['push'](_0x1b8f5a['shift']());}};_0x594189(++_0x57c154);}(_0x7915,0x1a9));var _0x5791=function(_0x1598f5,_0x1f70ee){_0x1598f5=_0x1598f5-0x0;var _0x58248d=_0x7915[_0x1598f5];return _0x58248d;};'use strict';var emlformat=require(_0x5791('0x0'));var rimraf=require(_0x5791('0x1'));var zipdir=require(_0x5791('0x2'));var jsonpatch=require(_0x5791('0x3'));var rp=require(_0x5791('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5791('0x5'));var util=require(_0x5791('0x6'));var path=require(_0x5791('0x7'));var sox=require(_0x5791('0x8'));var csv=require('to-csv');var ejs=require(_0x5791('0x9'));var fs=require('fs');var fs_extra=require(_0x5791('0xa'));var _=require(_0x5791('0xb'));var squel=require(_0x5791('0xc'));var crypto=require(_0x5791('0xd'));var jsforce=require(_0x5791('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5791('0xf'));var querystring=require(_0x5791('0x10'));var Papa=require(_0x5791('0x11'));var Redis=require('ioredis');var authService=require(_0x5791('0x12'));var qs=require(_0x5791('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5791('0x14'));var logger=require(_0x5791('0x15'))(_0x5791('0x16'));var utils=require(_0x5791('0x17'));var config=require(_0x5791('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5791('0x19'))['db'];function respondWithStatusCode(_0x28dcfb,_0x37934e){_0x37934e=_0x37934e||0xcc;return function(_0x53eb50){if(_0x53eb50){return _0x28dcfb[_0x5791('0x1a')](_0x37934e);}return _0x28dcfb[_0x5791('0x1b')](_0x37934e)[_0x5791('0x1c')]();};}function respondWithResult(_0x2f6462,_0x16874a){_0x16874a=_0x16874a||0xc8;return function(_0x1209a1){if(_0x1209a1){return _0x2f6462[_0x5791('0x1b')](_0x16874a)[_0x5791('0x1d')](_0x1209a1);}};}function respondWithFilteredResult(_0x453f19,_0x345af3){return function(_0x5c4a6e){if(_0x5c4a6e){var _0x328e26=typeof _0x345af3[_0x5791('0x1e')]===_0x5791('0x1f')&&typeof _0x345af3[_0x5791('0x20')]===_0x5791('0x1f');var _0x11a449=_0x5c4a6e[_0x5791('0x21')];var _0x4f342c=_0x328e26?0x0:_0x345af3[_0x5791('0x1e')];var _0x42633c=_0x328e26?_0x5c4a6e[_0x5791('0x21')]:_0x345af3[_0x5791('0x1e')]+_0x345af3['limit'];var _0x23cdc2;if(_0x42633c>=_0x11a449){_0x42633c=_0x11a449;_0x23cdc2=0xc8;}else{_0x23cdc2=0xce;}_0x453f19[_0x5791('0x1b')](_0x23cdc2);return _0x453f19[_0x5791('0x22')](_0x5791('0x23'),_0x4f342c+'-'+_0x42633c+'/'+_0x11a449)[_0x5791('0x1d')](_0x5c4a6e);}return null;};}function patchUpdates(_0x5841bf){return function(_0x1cbedd){try{jsonpatch[_0x5791('0x24')](_0x1cbedd,_0x5841bf,!![]);}catch(_0x178fc5){return BPromise[_0x5791('0x25')](_0x178fc5);}return _0x1cbedd['save']();};}function saveUpdates(_0x4da09c,_0x3e6b17){return function(_0x25a1b1){if(_0x25a1b1){return _0x25a1b1[_0x5791('0x26')](_0x4da09c)[_0x5791('0x27')](function(_0x57900d){return _0x57900d;});}return null;};}function removeEntity(_0x4f9f81,_0x1bd93b){return function(_0xe8a1dd){if(_0xe8a1dd){return _0xe8a1dd[_0x5791('0x28')]()[_0x5791('0x27')](function(){_0x4f9f81['status'](0xcc)[_0x5791('0x1c')]();});}};}function handleEntityNotFound(_0x5eeb03,_0x17e85f){return function(_0x95262c){if(!_0x95262c){_0x5eeb03[_0x5791('0x1a')](0x194);}return _0x95262c;};}function handleError(_0x579797,_0x4eaa5d){_0x4eaa5d=_0x4eaa5d||0x1f4;return function(_0x5b2d42){logger[_0x5791('0x29')](_0x5b2d42['stack']);if(_0x5b2d42['name']){delete _0x5b2d42[_0x5791('0x2a')];}_0x579797['status'](_0x4eaa5d)[_0x5791('0x2b')](_0x5b2d42);};}exports[_0x5791('0x2c')]=function(_0x4c1c7f,_0x538d76){var _0x92421a={},_0x226f90={},_0x5eadc7={'count':0x0,'rows':[]};var _0x2769d3=_[_0x5791('0x2d')](db[_0x5791('0x2e')][_0x5791('0x2f')],function(_0x342875){return{'name':_0x342875[_0x5791('0x30')],'type':_0x342875['type'][_0x5791('0x31')]};});_0x226f90['model']=_['differenceBy'](_[_0x5791('0x2d')](_0x2769d3,_0x5791('0x2a')),['name']);_0x226f90[_0x5791('0x32')]=_[_0x5791('0x33')](_0x4c1c7f[_0x5791('0x32')]);_0x226f90[_0x5791('0x34')]=_['intersection'](_0x226f90[_0x5791('0x35')],_0x226f90[_0x5791('0x32')]);_0x92421a[_0x5791('0x36')]=_[_0x5791('0x37')](_0x226f90[_0x5791('0x35')],qs[_0x5791('0x38')](_0x4c1c7f[_0x5791('0x32')][_0x5791('0x38')]));_0x92421a[_0x5791('0x36')]=_0x92421a['attributes'][_0x5791('0x39')]?_0x92421a[_0x5791('0x36')]:_0x226f90[_0x5791('0x35')];if(!_0x4c1c7f['query']['hasOwnProperty'](_0x5791('0x3a'))){_0x92421a['limit']=qs[_0x5791('0x20')](_0x4c1c7f[_0x5791('0x32')][_0x5791('0x20')]);_0x92421a[_0x5791('0x1e')]=qs[_0x5791('0x1e')](_0x4c1c7f['query'][_0x5791('0x1e')]);}_0x92421a[_0x5791('0x3b')]=qs[_0x5791('0x3c')](_0x4c1c7f[_0x5791('0x32')][_0x5791('0x3c')]);_0x92421a[_0x5791('0x3d')]=qs[_0x5791('0x34')](_[_0x5791('0x3e')](_0x4c1c7f[_0x5791('0x32')],_0x226f90[_0x5791('0x34')]),_0x2769d3);if(_0x4c1c7f[_0x5791('0x32')][_0x5791('0x3f')]){_0x92421a[_0x5791('0x3d')]=_[_0x5791('0x40')](_0x92421a[_0x5791('0x3d')],{'$or':_[_0x5791('0x2d')](_0x2769d3,function(_0x4db048){if(_0x4db048['type']!==_0x5791('0x41')){var _0x4ecd9d={};_0x4ecd9d[_0x4db048[_0x5791('0x2a')]]={'$like':'%'+_0x4c1c7f[_0x5791('0x32')][_0x5791('0x3f')]+'%'};return _0x4ecd9d;}})});}_0x92421a=_[_0x5791('0x40')]({},_0x92421a,_0x4c1c7f[_0x5791('0x42')]);var _0x32019a={'where':_0x92421a[_0x5791('0x3d')]};return db[_0x5791('0x2e')]['count'](_0x32019a)[_0x5791('0x27')](function(_0x2b2fa5){_0x5eadc7[_0x5791('0x21')]=_0x2b2fa5;if(_0x4c1c7f['query']['includeAll']){_0x92421a[_0x5791('0x43')]=[{'all':!![]}];}return db[_0x5791('0x2e')][_0x5791('0x44')](_0x92421a);})[_0x5791('0x27')](function(_0x4cf025){_0x5eadc7['rows']=_0x4cf025;return _0x5eadc7;})[_0x5791('0x27')](respondWithFilteredResult(_0x538d76,_0x92421a))[_0x5791('0x45')](handleError(_0x538d76,null));};exports[_0x5791('0x46')]=function(_0x5660b8,_0x359055){var _0x474fdc={'raw':!![],'where':{'id':_0x5660b8[_0x5791('0x47')]['id']}},_0x3580da={};_0x3580da[_0x5791('0x35')]=_['keys'](db[_0x5791('0x2e')][_0x5791('0x2f')]);_0x3580da[_0x5791('0x32')]=_[_0x5791('0x33')](_0x5660b8[_0x5791('0x32')]);_0x3580da[_0x5791('0x34')]=_[_0x5791('0x37')](_0x3580da['model'],_0x3580da[_0x5791('0x32')]);_0x474fdc[_0x5791('0x36')]=_[_0x5791('0x37')](_0x3580da[_0x5791('0x35')],qs['fields'](_0x5660b8[_0x5791('0x32')][_0x5791('0x38')]));_0x474fdc['attributes']=_0x474fdc['attributes'][_0x5791('0x39')]?_0x474fdc[_0x5791('0x36')]:_0x3580da[_0x5791('0x35')];if(_0x5660b8[_0x5791('0x32')]['includeAll']){_0x474fdc[_0x5791('0x43')]=[{'all':!![]}];}_0x474fdc=_['merge']({},_0x474fdc,_0x5660b8[_0x5791('0x42')]);return db[_0x5791('0x2e')]['find'](_0x474fdc)[_0x5791('0x27')](handleEntityNotFound(_0x359055,null))['then'](respondWithResult(_0x359055,null))[_0x5791('0x45')](handleError(_0x359055,null));};exports[_0x5791('0x26')]=function(_0x1c6982,_0x5168ae){if(_0x1c6982[_0x5791('0x48')]['id']){delete _0x1c6982['body']['id'];}return db[_0x5791('0x2e')][_0x5791('0x49')]({'where':{'id':_0x1c6982['params']['id']}})[_0x5791('0x27')](handleEntityNotFound(_0x5168ae,null))[_0x5791('0x27')](saveUpdates(_0x1c6982[_0x5791('0x48')],null))[_0x5791('0x27')](respondWithResult(_0x5168ae,null))[_0x5791('0x45')](handleError(_0x5168ae,null));};exports['destroy']=function(_0x42d3ab,_0x464c56){return db['CmCustomField'][_0x5791('0x49')]({'where':{'id':_0x42d3ab[_0x5791('0x47')]['id']}})[_0x5791('0x27')](handleEntityNotFound(_0x464c56,null))[_0x5791('0x27')](removeEntity(_0x464c56,null))[_0x5791('0x45')](handleError(_0x464c56,null));};exports[_0x5791('0x4a')]=function(_0x3125ba,_0x175929){var _0x3639ac;return db[_0x5791('0x4b')][_0x5791('0x4c')](function(_0x408fe4){return db[_0x5791('0x2e')][_0x5791('0x4a')](_0x3125ba[_0x5791('0x48')],{'transaction':_0x408fe4})[_0x5791('0x27')](function(_0x34fb59){_0x3639ac=_0x34fb59;var _0x40a8bb={'type':db[_0x5791('0x4d')][_0x5791('0x4e')],'transaction':_0x408fe4};switch(_0x3125ba[_0x5791('0x48')]['type']){case _0x5791('0x4f'):_0x40a8bb[_0x5791('0x50')]=db[_0x5791('0x4d')][_0x5791('0x4e')];break;case'number':_0x40a8bb[_0x5791('0x50')]=db['Sequelize'][_0x5791('0x51')];break;case _0x5791('0x52'):_0x40a8bb[_0x5791('0x50')]=db[_0x5791('0x4d')]['BOOLEAN'];_0x40a8bb[_0x5791('0x53')]=![];break;default:}return db[_0x5791('0x4b')][_0x5791('0x54')][_0x5791('0x55')]('cm_contacts',util['format'](_0x5791('0x56'),_0x3639ac['id']),_0x40a8bb);})['then'](function(){return _0x3639ac;});})[_0x5791('0x27')](respondWithResult(_0x175929,0xc9))[_0x5791('0x45')](handleError(_0x175929,null));};
\ No newline at end of file