Built motion from commit (unavailable).|2.3.93
[motion2.git] / server / api / cmCustomField / cmCustomField.controller.js
index e8ae9bd..a390faf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc00d=['CmCustomField','includeAll','include','rows','show','params','options','find','catch','body','create','Sequelize','TEXT','text','number','INTEGER','defaultValue','queryInterface','addColumn','cm_contacts','format','html-pdf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','rawAttributes','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','map','type','key','field','where'];(function(_0x456fcb,_0x4bfdb9){var _0x124da9=function(_0x3f9fab){while(--_0x3f9fab){_0x456fcb['push'](_0x456fcb['shift']());}};_0x124da9(++_0x4bfdb9);}(_0xc00d,0x1a5));var _0xdc00=function(_0x2eb0d0,_0x4fc83c){_0x2eb0d0=_0x2eb0d0-0x0;var _0x41e53e=_0xc00d[_0x2eb0d0];return _0x41e53e;};'use strict';var pdf=require(_0xdc00('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdc00('0x1'));var rp=require(_0xdc00('0x2'));var moment=require('moment');var BPromise=require(_0xdc00('0x3'));var Mustache=require(_0xdc00('0x4'));var util=require('util');var path=require(_0xdc00('0x5'));var sox=require(_0xdc00('0x6'));var csv=require(_0xdc00('0x7'));var ejs=require(_0xdc00('0x8'));var fs=require('fs');var _=require(_0xdc00('0x9'));var squel=require(_0xdc00('0xa'));var crypto=require(_0xdc00('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdc00('0xc'));var toCsv=require(_0xdc00('0x7'));var querystring=require(_0xdc00('0xd'));var Papa=require('papaparse');var authService=require(_0xdc00('0xe'));var hardwareService=require(_0xdc00('0xf'));var Redis=require('ioredis');var qs=require(_0xdc00('0x10'));var logger=require('../../config/logger')(_0xdc00('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xdc00('0x12'))['db'];function respondWithStatusCode(_0x370030,_0x5f343b){_0x5f343b=_0x5f343b||0xcc;return function(_0x1e4aec){if(_0x1e4aec){return _0x370030[_0xdc00('0x13')](_0x5f343b);}return _0x370030[_0xdc00('0x14')](_0x5f343b)[_0xdc00('0x15')]();};}function respondWithResult(_0x28ee9d,_0x3748de){_0x3748de=_0x3748de||0xc8;return function(_0x181ed9){if(_0x181ed9){return _0x28ee9d[_0xdc00('0x14')](_0x3748de)[_0xdc00('0x16')](_0x181ed9);}};}function respondWithFilteredResult(_0xc9e4c2,_0x2a20ef){return function(_0x24ca85){if(_0x24ca85){var _0x528037=_0x24ca85[_0xdc00('0x17')],_0x27903f=_0x2a20ef['offset'],_0x4a3638=_0x2a20ef[_0xdc00('0x18')]+_0x2a20ef['limit'],_0x2aaa72;if(_0x4a3638>=_0x528037){_0x4a3638=_0x528037;_0x2aaa72=0xc8;}else{_0x2aaa72=0xce;}_0xc9e4c2[_0xdc00('0x14')](_0x2aaa72);return _0xc9e4c2[_0xdc00('0x19')](_0xdc00('0x1a'),_0x27903f+'-'+_0x4a3638+'/'+_0x528037)['json'](_0x24ca85);}return null;};}function patchUpdates(_0x540271){return function(_0x28310b){try{jsonpatch[_0xdc00('0x1b')](_0x28310b,_0x540271,!![]);}catch(_0x5b022e){return BPromise[_0xdc00('0x1c')](_0x5b022e);}return _0x28310b[_0xdc00('0x1d')]();};}function saveUpdates(_0x1397c3,_0x5776d7){return function(_0x3db785){if(_0x3db785){return _0x3db785[_0xdc00('0x1e')](_0x1397c3)[_0xdc00('0x1f')](function(_0x4a47de){return _0x4a47de;});}return null;};}function removeEntity(_0x2384ff,_0x29de2a){return function(_0x58cdee){if(_0x58cdee){return _0x58cdee[_0xdc00('0x20')]()[_0xdc00('0x1f')](function(){_0x2384ff[_0xdc00('0x14')](0xcc)[_0xdc00('0x15')]();});}};}function handleEntityNotFound(_0x6ce55f,_0x18f4a7){return function(_0x5dde61){if(!_0x5dde61){_0x6ce55f[_0xdc00('0x13')](0x194);}return _0x5dde61;};}function handleError(_0x1d9bc7,_0x398bea){_0x398bea=_0x398bea||0x1f4;return function(_0x45212a){logger[_0xdc00('0x21')](_0x45212a['stack']);if(_0x45212a[_0xdc00('0x22')]){delete _0x45212a['name'];}_0x1d9bc7['status'](_0x398bea)[_0xdc00('0x23')](_0x45212a);};}exports['index']=function(_0x288ca0,_0x5daddd){var _0x1ad93b={},_0x5b59a8={},_0x4014d9={'count':0x0,'rows':[]};var _0x512f9f=db['CmCustomField'][_0xdc00('0x24')];_0x5b59a8[_0xdc00('0x25')]=_[_0xdc00('0x26')](_[_0xdc00('0x27')](_0x512f9f),['name']);_0x5b59a8[_0xdc00('0x28')]=_['keys'](_0x288ca0['query']);_0x5b59a8[_0xdc00('0x29')]=_[_0xdc00('0x2a')](_0x5b59a8[_0xdc00('0x25')],_0x5b59a8['query']);_0x1ad93b['attributes']=_['intersection'](_0x5b59a8[_0xdc00('0x25')],qs[_0xdc00('0x2b')](_0x288ca0[_0xdc00('0x28')][_0xdc00('0x2b')]));_0x1ad93b[_0xdc00('0x2c')]=_0x1ad93b[_0xdc00('0x2c')][_0xdc00('0x2d')]?_0x1ad93b['attributes']:_0x5b59a8[_0xdc00('0x25')];if(!_0x288ca0[_0xdc00('0x28')][_0xdc00('0x2e')](_0xdc00('0x2f'))){_0x1ad93b[_0xdc00('0x30')]=qs[_0xdc00('0x30')](_0x288ca0[_0xdc00('0x28')][_0xdc00('0x30')]);_0x1ad93b[_0xdc00('0x18')]=qs[_0xdc00('0x18')](_0x288ca0[_0xdc00('0x28')][_0xdc00('0x18')]);}_0x1ad93b[_0xdc00('0x31')]=qs[_0xdc00('0x32')](_0x288ca0['query'][_0xdc00('0x32')]);_0x1ad93b['where']=qs[_0xdc00('0x29')](_[_0xdc00('0x33')](_0x288ca0[_0xdc00('0x28')],_0x5b59a8['filters']));if(_0x288ca0['query'][_0xdc00('0x34')]){_0x1ad93b['where']=_[_0xdc00('0x35')](_0x1ad93b['where'],{'$or':_[_0xdc00('0x36')](_0x512f9f,function(_0x54e9f4){if(_0x54e9f4[_0xdc00('0x37')][_0xdc00('0x38')]!=='VIRTUAL'){var _0x336dc9={};_0x336dc9[_0x54e9f4[_0xdc00('0x39')]]={'$like':'%'+_0x288ca0[_0xdc00('0x28')][_0xdc00('0x34')]+'%'};return _0x336dc9;}})});}_0x1ad93b=_['merge']({},_0x1ad93b,_0x288ca0['options']);var _0x5c7f15={'where':_0x1ad93b[_0xdc00('0x3a')]};return db[_0xdc00('0x3b')]['count'](_0x5c7f15)['then'](function(_0x51e15c){_0x4014d9[_0xdc00('0x17')]=_0x51e15c;if(_0x288ca0[_0xdc00('0x28')][_0xdc00('0x3c')]){_0x1ad93b[_0xdc00('0x3d')]=[{'all':!![]}];}return db[_0xdc00('0x3b')]['findAll'](_0x1ad93b);})[_0xdc00('0x1f')](function(_0x4a31b5){_0x4014d9[_0xdc00('0x3e')]=_0x4a31b5;return _0x4014d9;})[_0xdc00('0x1f')](respondWithFilteredResult(_0x5daddd,_0x1ad93b))['catch'](handleError(_0x5daddd,null));};exports[_0xdc00('0x3f')]=function(_0x575f77,_0x8d8a08){var _0x5f0d5c={'raw':!![],'where':{'id':_0x575f77[_0xdc00('0x40')]['id']}},_0x2b7b53={};_0x2b7b53[_0xdc00('0x25')]=_['keys'](db['CmCustomField']['rawAttributes']);_0x2b7b53['query']=_[_0xdc00('0x27')](_0x575f77[_0xdc00('0x28')]);_0x2b7b53[_0xdc00('0x29')]=_[_0xdc00('0x2a')](_0x2b7b53['model'],_0x2b7b53[_0xdc00('0x28')]);_0x5f0d5c[_0xdc00('0x2c')]=_[_0xdc00('0x2a')](_0x2b7b53[_0xdc00('0x25')],qs[_0xdc00('0x2b')](_0x575f77[_0xdc00('0x28')][_0xdc00('0x2b')]));_0x5f0d5c['attributes']=_0x5f0d5c[_0xdc00('0x2c')][_0xdc00('0x2d')]?_0x5f0d5c[_0xdc00('0x2c')]:_0x2b7b53[_0xdc00('0x25')];if(_0x575f77[_0xdc00('0x28')]['includeAll']){_0x5f0d5c[_0xdc00('0x3d')]=[{'all':!![]}];}_0x5f0d5c=_[_0xdc00('0x35')]({},_0x5f0d5c,_0x575f77[_0xdc00('0x41')]);return db[_0xdc00('0x3b')][_0xdc00('0x42')](_0x5f0d5c)[_0xdc00('0x1f')](handleEntityNotFound(_0x8d8a08,null))['then'](respondWithResult(_0x8d8a08,null))[_0xdc00('0x43')](handleError(_0x8d8a08,null));};exports['update']=function(_0x152df9,_0x2eb47d){if(_0x152df9[_0xdc00('0x44')]['id']){delete _0x152df9[_0xdc00('0x44')]['id'];}return db[_0xdc00('0x3b')]['find']({'where':{'id':_0x152df9[_0xdc00('0x40')]['id']}})[_0xdc00('0x1f')](handleEntityNotFound(_0x2eb47d,null))[_0xdc00('0x1f')](saveUpdates(_0x152df9[_0xdc00('0x44')],null))[_0xdc00('0x1f')](respondWithResult(_0x2eb47d,null))['catch'](handleError(_0x2eb47d,null));};exports[_0xdc00('0x20')]=function(_0x198044,_0x5ad1df){return db['CmCustomField']['find']({'where':{'id':_0x198044[_0xdc00('0x40')]['id']}})[_0xdc00('0x1f')](handleEntityNotFound(_0x5ad1df,null))[_0xdc00('0x1f')](removeEntity(_0x5ad1df,null))[_0xdc00('0x43')](handleError(_0x5ad1df,null));};exports[_0xdc00('0x45')]=function(_0x4f6b67,_0x48c068){var _0x42e54c;return db['sequelize']['transaction'](function(_0x5260ea){return db[_0xdc00('0x3b')][_0xdc00('0x45')](_0x4f6b67['body'],{'transaction':_0x5260ea})[_0xdc00('0x1f')](function(_0x534666){_0x42e54c=_0x534666;var _0x4452b5={'type':db[_0xdc00('0x46')][_0xdc00('0x47')],'transaction':_0x5260ea};switch(_0x4f6b67[_0xdc00('0x44')]['type']){case _0xdc00('0x48'):_0x4452b5[_0xdc00('0x37')]=db[_0xdc00('0x46')]['TEXT'];break;case _0xdc00('0x49'):_0x4452b5['type']=db[_0xdc00('0x46')][_0xdc00('0x4a')];break;case'switch':_0x4452b5[_0xdc00('0x37')]=db[_0xdc00('0x46')]['BOOLEAN'];_0x4452b5[_0xdc00('0x4b')]=![];break;default:}return db['sequelize'][_0xdc00('0x4c')][_0xdc00('0x4d')](_0xdc00('0x4e'),util[_0xdc00('0x4f')]('cf_%d',_0x42e54c['id']),_0x4452b5);})[_0xdc00('0x1f')](function(){return _0x42e54c;});})[_0xdc00('0x1f')](respondWithResult(_0x48c068,0xc9))[_0xdc00('0x43')](handleError(_0x48c068,null));};
\ No newline at end of file
+var _0xbb08=['field','filter','options','then','includeAll','include','findAll','rows','show','params','find','catch','body','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','stack','name','send','index','CmCustomField','rawAttributes','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','VIRTUAL'];(function(_0x4e6eb2,_0x3ea359){var _0x36240c=function(_0xadf867){while(--_0xadf867){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x36240c(++_0x3ea359);}(_0xbb08,0xce));var _0x8bb0=function(_0x1dd636,_0x439ecd){_0x1dd636=_0x1dd636-0x0;var _0x4571a0=_0xbb08[_0x1dd636];return _0x4571a0;};'use strict';var pdf=require(_0x8bb0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8bb0('0x1'));var zipdir=require(_0x8bb0('0x2'));var jsonpatch=require(_0x8bb0('0x3'));var rp=require(_0x8bb0('0x4'));var moment=require(_0x8bb0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8bb0('0x6'));var util=require(_0x8bb0('0x7'));var path=require('path');var sox=require(_0x8bb0('0x8'));var csv=require(_0x8bb0('0x9'));var ejs=require(_0x8bb0('0xa'));var fs=require('fs');var _=require(_0x8bb0('0xb'));var squel=require(_0x8bb0('0xc'));var crypto=require('crypto');var jsforce=require(_0x8bb0('0xd'));var deskjs=require(_0x8bb0('0xe'));var toCsv=require(_0x8bb0('0x9'));var querystring=require(_0x8bb0('0xf'));var Papa=require(_0x8bb0('0x10'));var authService=require(_0x8bb0('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x8bb0('0x12'));var qs=require(_0x8bb0('0x13'));var logger=require(_0x8bb0('0x14'))(_0x8bb0('0x15'));var utils=require(_0x8bb0('0x16'));var config=require(_0x8bb0('0x17'));var db=require(_0x8bb0('0x18'))['db'];function respondWithStatusCode(_0x286ab3,_0x484b31){_0x484b31=_0x484b31||0xcc;return function(_0x215ef5){if(_0x215ef5){return _0x286ab3[_0x8bb0('0x19')](_0x484b31);}return _0x286ab3[_0x8bb0('0x1a')](_0x484b31)[_0x8bb0('0x1b')]();};}function respondWithResult(_0x5b1a79,_0x3ce545){_0x3ce545=_0x3ce545||0xc8;return function(_0x961355){if(_0x961355){return _0x5b1a79[_0x8bb0('0x1a')](_0x3ce545)[_0x8bb0('0x1c')](_0x961355);}};}function respondWithFilteredResult(_0x53687d,_0x122466){return function(_0x33fbb1){if(_0x33fbb1){var _0x7e2c8e=_0x33fbb1[_0x8bb0('0x1d')],_0x1c4040=_0x122466[_0x8bb0('0x1e')],_0x23bc53=_0x122466[_0x8bb0('0x1e')]+_0x122466['limit'],_0x481f80;if(_0x23bc53>=_0x7e2c8e){_0x23bc53=_0x7e2c8e;_0x481f80=0xc8;}else{_0x481f80=0xce;}_0x53687d[_0x8bb0('0x1a')](_0x481f80);return _0x53687d[_0x8bb0('0x1f')](_0x8bb0('0x20'),_0x1c4040+'-'+_0x23bc53+'/'+_0x7e2c8e)[_0x8bb0('0x1c')](_0x33fbb1);}return null;};}function patchUpdates(_0x4ae260){return function(_0x14dfdf){try{jsonpatch[_0x8bb0('0x21')](_0x14dfdf,_0x4ae260,!![]);}catch(_0xe91580){return BPromise[_0x8bb0('0x22')](_0xe91580);}return _0x14dfdf['save']();};}function saveUpdates(_0x86f838,_0x1713d7){return function(_0x7c516e){if(_0x7c516e){return _0x7c516e[_0x8bb0('0x23')](_0x86f838)['then'](function(_0x3be711){return _0x3be711;});}return null;};}function removeEntity(_0x1d34b2,_0x2427a2){return function(_0x1402ad){if(_0x1402ad){return _0x1402ad['destroy']()['then'](function(){_0x1d34b2[_0x8bb0('0x1a')](0xcc)[_0x8bb0('0x1b')]();});}};}function handleEntityNotFound(_0x350d2d,_0x5cb107){return function(_0x4a54a2){if(!_0x4a54a2){_0x350d2d[_0x8bb0('0x19')](0x194);}return _0x4a54a2;};}function handleError(_0x4acadc,_0x20342a){_0x20342a=_0x20342a||0x1f4;return function(_0x4b4723){logger['error'](_0x4b4723[_0x8bb0('0x24')]);if(_0x4b4723[_0x8bb0('0x25')]){delete _0x4b4723[_0x8bb0('0x25')];}_0x4acadc[_0x8bb0('0x1a')](_0x20342a)[_0x8bb0('0x26')](_0x4b4723);};}exports[_0x8bb0('0x27')]=function(_0x4e3d52,_0x283713){var _0x5ced4e={},_0x5fc956={},_0x3f8a50={'count':0x0,'rows':[]};var _0x4bb65b=db[_0x8bb0('0x28')][_0x8bb0('0x29')];_0x5fc956[_0x8bb0('0x2a')]=_['differenceBy'](_[_0x8bb0('0x2b')](_0x4bb65b),[_0x8bb0('0x25')]);_0x5fc956[_0x8bb0('0x2c')]=_['keys'](_0x4e3d52['query']);_0x5fc956[_0x8bb0('0x2d')]=_[_0x8bb0('0x2e')](_0x5fc956[_0x8bb0('0x2a')],_0x5fc956[_0x8bb0('0x2c')]);_0x5ced4e['attributes']=_[_0x8bb0('0x2e')](_0x5fc956['model'],qs[_0x8bb0('0x2f')](_0x4e3d52['query'][_0x8bb0('0x2f')]));_0x5ced4e['attributes']=_0x5ced4e['attributes'][_0x8bb0('0x30')]?_0x5ced4e[_0x8bb0('0x31')]:_0x5fc956[_0x8bb0('0x2a')];if(!_0x4e3d52['query'][_0x8bb0('0x32')](_0x8bb0('0x33'))){_0x5ced4e[_0x8bb0('0x34')]=qs[_0x8bb0('0x34')](_0x4e3d52[_0x8bb0('0x2c')]['limit']);_0x5ced4e[_0x8bb0('0x1e')]=qs[_0x8bb0('0x1e')](_0x4e3d52[_0x8bb0('0x2c')][_0x8bb0('0x1e')]);}_0x5ced4e[_0x8bb0('0x35')]=qs[_0x8bb0('0x36')](_0x4e3d52[_0x8bb0('0x2c')]['sort']);_0x5ced4e[_0x8bb0('0x37')]=qs['filters'](_[_0x8bb0('0x38')](_0x4e3d52[_0x8bb0('0x2c')],_0x5fc956[_0x8bb0('0x2d')]));if(_0x4e3d52[_0x8bb0('0x2c')]['filter']){_0x5ced4e['where']=_[_0x8bb0('0x39')](_0x5ced4e['where'],{'$or':_[_0x8bb0('0x3a')](_0x4bb65b,function(_0x27c14b){if(_0x27c14b[_0x8bb0('0x3b')]['key']!==_0x8bb0('0x3c')){var _0x37d472={};_0x37d472[_0x27c14b[_0x8bb0('0x3d')]]={'$like':'%'+_0x4e3d52[_0x8bb0('0x2c')][_0x8bb0('0x3e')]+'%'};return _0x37d472;}})});}_0x5ced4e=_[_0x8bb0('0x39')]({},_0x5ced4e,_0x4e3d52[_0x8bb0('0x3f')]);var _0x43b005={'where':_0x5ced4e['where']};return db[_0x8bb0('0x28')][_0x8bb0('0x1d')](_0x43b005)[_0x8bb0('0x40')](function(_0x46eea7){_0x3f8a50[_0x8bb0('0x1d')]=_0x46eea7;if(_0x4e3d52[_0x8bb0('0x2c')][_0x8bb0('0x41')]){_0x5ced4e[_0x8bb0('0x42')]=[{'all':!![]}];}return db[_0x8bb0('0x28')][_0x8bb0('0x43')](_0x5ced4e);})[_0x8bb0('0x40')](function(_0x19ac50){_0x3f8a50[_0x8bb0('0x44')]=_0x19ac50;return _0x3f8a50;})[_0x8bb0('0x40')](respondWithFilteredResult(_0x283713,_0x5ced4e))['catch'](handleError(_0x283713,null));};exports[_0x8bb0('0x45')]=function(_0xf5874a,_0x5221ec){var _0x30eee7={'raw':!![],'where':{'id':_0xf5874a[_0x8bb0('0x46')]['id']}},_0x93387d={};_0x93387d[_0x8bb0('0x2a')]=_['keys'](db[_0x8bb0('0x28')][_0x8bb0('0x29')]);_0x93387d[_0x8bb0('0x2c')]=_['keys'](_0xf5874a[_0x8bb0('0x2c')]);_0x93387d[_0x8bb0('0x2d')]=_['intersection'](_0x93387d['model'],_0x93387d[_0x8bb0('0x2c')]);_0x30eee7[_0x8bb0('0x31')]=_['intersection'](_0x93387d[_0x8bb0('0x2a')],qs[_0x8bb0('0x2f')](_0xf5874a[_0x8bb0('0x2c')][_0x8bb0('0x2f')]));_0x30eee7[_0x8bb0('0x31')]=_0x30eee7[_0x8bb0('0x31')][_0x8bb0('0x30')]?_0x30eee7[_0x8bb0('0x31')]:_0x93387d[_0x8bb0('0x2a')];if(_0xf5874a[_0x8bb0('0x2c')]['includeAll']){_0x30eee7[_0x8bb0('0x42')]=[{'all':!![]}];}_0x30eee7=_[_0x8bb0('0x39')]({},_0x30eee7,_0xf5874a[_0x8bb0('0x3f')]);return db[_0x8bb0('0x28')][_0x8bb0('0x47')](_0x30eee7)[_0x8bb0('0x40')](handleEntityNotFound(_0x5221ec,null))[_0x8bb0('0x40')](respondWithResult(_0x5221ec,null))[_0x8bb0('0x48')](handleError(_0x5221ec,null));};exports[_0x8bb0('0x23')]=function(_0x32f122,_0x13f7a4){if(_0x32f122[_0x8bb0('0x49')]['id']){delete _0x32f122[_0x8bb0('0x49')]['id'];}return db[_0x8bb0('0x28')][_0x8bb0('0x47')]({'where':{'id':_0x32f122['params']['id']}})[_0x8bb0('0x40')](handleEntityNotFound(_0x13f7a4,null))[_0x8bb0('0x40')](saveUpdates(_0x32f122[_0x8bb0('0x49')],null))[_0x8bb0('0x40')](respondWithResult(_0x13f7a4,null))[_0x8bb0('0x48')](handleError(_0x13f7a4,null));};exports['destroy']=function(_0x25e93e,_0x273dd7){return db['CmCustomField'][_0x8bb0('0x47')]({'where':{'id':_0x25e93e[_0x8bb0('0x46')]['id']}})[_0x8bb0('0x40')](handleEntityNotFound(_0x273dd7,null))[_0x8bb0('0x40')](removeEntity(_0x273dd7,null))[_0x8bb0('0x48')](handleError(_0x273dd7,null));};exports[_0x8bb0('0x4a')]=function(_0x5761bc,_0x26e52f){var _0x4ca48b;return db[_0x8bb0('0x4b')][_0x8bb0('0x4c')](function(_0x317559){return db[_0x8bb0('0x28')][_0x8bb0('0x4a')](_0x5761bc['body'],{'transaction':_0x317559})[_0x8bb0('0x40')](function(_0x5d8fa7){_0x4ca48b=_0x5d8fa7;var _0x271882={'type':db['Sequelize'][_0x8bb0('0x4d')],'transaction':_0x317559};switch(_0x5761bc[_0x8bb0('0x49')][_0x8bb0('0x3b')]){case _0x8bb0('0x4e'):_0x271882['type']=db[_0x8bb0('0x4f')]['TEXT'];break;case _0x8bb0('0x50'):_0x271882[_0x8bb0('0x3b')]=db[_0x8bb0('0x4f')][_0x8bb0('0x51')];break;case _0x8bb0('0x52'):_0x271882[_0x8bb0('0x3b')]=db[_0x8bb0('0x4f')][_0x8bb0('0x53')];_0x271882[_0x8bb0('0x54')]=![];break;default:}return db[_0x8bb0('0x4b')][_0x8bb0('0x55')][_0x8bb0('0x56')]('cm_contacts',util[_0x8bb0('0x57')](_0x8bb0('0x58'),_0x4ca48b['id']),_0x271882);})['then'](function(){return _0x4ca48b;});})[_0x8bb0('0x40')](respondWithResult(_0x26e52f,0xc9))['catch'](handleError(_0x26e52f,null));};
\ No newline at end of file