Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / faxMessage / faxMessage.model.js
index f29496f..80fdccb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa258=['secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','FaxMessage','fti_fax_messages','models','toLowerCase','direction'];(function(_0x51af00,_0x293964){var _0x25bad7=function(_0x8b078b){while(--_0x8b078b){_0x51af00['push'](_0x51af00['shift']());}};_0x25bad7(++_0x293964);}(_0xa258,0x88));var _0x8a25=function(_0x924aed,_0x3bca33){_0x924aed=_0x924aed-0x0;var _0x4f644e=_0xa258[_0x924aed];return _0x4f644e;};'use strict';var _=require('lodash');var util=require(_0x8a25('0x0'));var logger=require(_0x8a25('0x1'))(_0x8a25('0x2'));var moment=require(_0x8a25('0x3'));var BPromise=require('bluebird');var rp=require(_0x8a25('0x4'));var fs=require('fs');var path=require(_0x8a25('0x5'));var rimraf=require(_0x8a25('0x6'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x8a25('0x7')]=function(_0x3faf12,_0x30bf24){return _0x3faf12[_0x8a25('0x8')](_0x8a25('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x8a25('0xa'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x168596,_0x9d8c8a,_0x350c1d){var _0x24182c=_0x3faf12[_0x8a25('0xb')];var _0x24959c=_0x168596['get']({'plain':!![]});if(_0x24959c['direction'][_0x8a25('0xc')]()==='in'||_0x24959c[_0x8a25('0xd')][_0x8a25('0xc')]()==='out'&&!_0x24959c[_0x8a25('0xe')]&&!_['isNil'](_0x24959c[_0x8a25('0xf')])){_0x24182c[_0x8a25('0x10')][_0x8a25('0x11')]({'where':{'id':_0x24959c[_0x8a25('0x12')]}})[_0x8a25('0x13')](function(_0x1f47b5){if(_0x1f47b5){_0x1f47b5[_0x8a25('0x14')]({'lastMsgAt':_0x24959c[_0x8a25('0x15')],'lastMsgDirection':_0x24959c[_0x8a25('0xd')]['toLowerCase']()});}})[_0x8a25('0x16')](function(_0x5c4bd2){console[_0x8a25('0x17')](_0x5c4bd2);});}_0x350c1d();}},'charset':_0x8a25('0x18'),'collate':'utf8mb4_unicode_ci'});};
\ 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