Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / faxMessage / faxMessage.model.js
index 17a6aee..80fdccb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9c5=['get','direction','toLowerCase','secret','UserId','FaxInteraction','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models'];(function(_0x462c8d,_0x308cea){var _0x963b90=function(_0x4f71d8){while(--_0x4f71d8){_0x462c8d['push'](_0x462c8d['shift']());}};_0x963b90(++_0x308cea);}(_0xa9c5,0x15d));var _0x5a9c=function(_0x3ff55a,_0x2b6451){_0x3ff55a=_0x3ff55a-0x0;var _0x420ef1=_0xa9c5[_0x3ff55a];return _0x420ef1;};'use strict';var _=require('lodash');var util=require(_0x5a9c('0x0'));var logger=require(_0x5a9c('0x1'))(_0x5a9c('0x2'));var moment=require('moment');var BPromise=require(_0x5a9c('0x3'));var rp=require(_0x5a9c('0x4'));var fs=require('fs');var path=require(_0x5a9c('0x5'));var rimraf=require(_0x5a9c('0x6'));var config=require(_0x5a9c('0x7'));var attributes=require(_0x5a9c('0x8'));module['exports']=function(_0x55456e,_0x58bfd8){return _0x55456e[_0x5a9c('0x9')](_0x5a9c('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x5a9c('0xb'),'fields':[_0x5a9c('0xc')],'type':_0x5a9c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d1a81,_0x2ae123,_0x1c5815){var _0x31aba0=_0x55456e[_0x5a9c('0xe')];var _0x327cbd=_0x1d1a81[_0x5a9c('0xf')]({'plain':!![]});if(_0x327cbd[_0x5a9c('0x10')]['toLowerCase']()==='in'||_0x327cbd['direction'][_0x5a9c('0x11')]()==='out'&&!_0x327cbd[_0x5a9c('0x12')]&&!_['isNil'](_0x327cbd[_0x5a9c('0x13')])){_0x31aba0[_0x5a9c('0x14')]['findOne']({'where':{'id':_0x327cbd['FaxInteractionId']}})[_0x5a9c('0x15')](function(_0x5b262a){if(_0x5b262a){_0x5b262a[_0x5a9c('0x16')]({'lastMsgAt':_0x327cbd[_0x5a9c('0x17')],'lastMsgDirection':_0x327cbd[_0x5a9c('0x10')][_0x5a9c('0x11')]()});}})['catch'](function(_0x167a7d){console['error'](_0x167a7d);});}_0x1c5815();}},'charset':_0x5a9c('0x18'),'collate':_0x5a9c('0x19')});};
\ No newline at end of file
+var _0xbb0e=['get','direction','toLowerCase','UserId','FaxInteraction','findOne','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fti_fax_messages','models'];(function(_0x26d1f7,_0x961352){var _0x27e813=function(_0x576387){while(--_0x576387){_0x26d1f7['push'](_0x26d1f7['shift']());}};_0x27e813(++_0x961352);}(_0xbb0e,0x15e));var _0xebb0=function(_0x462351,_0x337118){_0x462351=_0x462351-0x0;var _0x21e182=_0xbb0e[_0x462351];return _0x21e182;};'use strict';var _=require(_0xebb0('0x0'));var util=require('util');var logger=require(_0xebb0('0x1'))(_0xebb0('0x2'));var moment=require(_0xebb0('0x3'));var BPromise=require(_0xebb0('0x4'));var rp=require(_0xebb0('0x5'));var fs=require('fs');var path=require(_0xebb0('0x6'));var rimraf=require(_0xebb0('0x7'));var config=require(_0xebb0('0x8'));var attributes=require(_0xebb0('0x9'));module[_0xebb0('0xa')]=function(_0xde6eed,_0x3e4bfe){return _0xde6eed['define'](_0xebb0('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xebb0('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x37e872,_0x3cf9ba,_0x1993d8){var _0x1c6373=_0xde6eed[_0xebb0('0xd')];var _0x7fb08c=_0x37e872[_0xebb0('0xe')]({'plain':!![]});if(_0x7fb08c[_0xebb0('0xf')][_0xebb0('0x10')]()==='in'||_0x7fb08c[_0xebb0('0xf')]['toLowerCase']()==='out'&&!_0x7fb08c['secret']&&!_['isNil'](_0x7fb08c[_0xebb0('0x11')])){_0x1c6373[_0xebb0('0x12')][_0xebb0('0x13')]({'where':{'id':_0x7fb08c['FaxInteractionId']}})['then'](function(_0x5d46d3){if(_0x5d46d3){_0x5d46d3[_0xebb0('0x14')]({'lastMsgAt':_0x7fb08c[_0xebb0('0x15')],'lastMsgDirection':_0x7fb08c['direction'][_0xebb0('0x10')]()});}})[_0xebb0('0x16')](function(_0x492f2f){console[_0xebb0('0x17')](_0x492f2f);});}_0x1993d8();}},'charset':_0xebb0('0x18'),'collate':_0xebb0('0x19')});};
\ No newline at end of file