Built motion from commit (unavailable).|2.4.20
[motion2.git] / server / api / cmContact / cmContact.rpc.js
index 932e223..646ce9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f64=['request\x20sent','debug','stringify','error','code','message','result','catch','ShowCmContact','CmContact','find','options','raw','where','map','attributes','include','CreateCmContact','create','body','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x7f64,0xb4));var _0x47f6=function(_0x16245b,_0x353df5){_0x16245b=_0x16245b-0x0;var _0x8bbb56=_0x7f64[_0x16245b];return _0x8bbb56;};'use strict';var _=require('lodash');var util=require(_0x47f6('0x0'));var moment=require(_0x47f6('0x1'));var BPromise=require(_0x47f6('0x2'));var rs=require(_0x47f6('0x3'));var fs=require('fs');var Redis=require(_0x47f6('0x4'));var db=require(_0x47f6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x47f6('0x6'))(_0x47f6('0x7'));var config=require('../../config/environment');var jayson=require(_0x47f6('0x8'));var client=jayson[_0x47f6('0x9')][_0x47f6('0xa')]({'port':0x232a});config[_0x47f6('0xb')]=_['defaults'](config[_0x47f6('0xb')],{'host':_0x47f6('0xc'),'port':0x18eb});var socket=require(_0x47f6('0xd'))(new Redis(config['redis']));require(_0x47f6('0xe'))[_0x47f6('0xf')](socket);function respondWithRpcPromise(_0x56aa67,_0x4f0e83,_0x6aa682){return new BPromise(function(_0x9d3210,_0x4212b8){return client[_0x47f6('0x10')](_0x56aa67,_0x6aa682)[_0x47f6('0x11')](function(_0x1668b8){logger[_0x47f6('0x12')](_0x47f6('0x13'),_0x4f0e83,_0x47f6('0x14'));logger[_0x47f6('0x15')]('CmContact,\x20%s,\x20%s,\x20%s',_0x4f0e83,'request\x20sent',JSON[_0x47f6('0x16')](_0x1668b8));if(_0x1668b8[_0x47f6('0x17')]){if(_0x1668b8['error'][_0x47f6('0x18')]===0x1f4){logger[_0x47f6('0x17')](_0x47f6('0x13'),_0x4f0e83,_0x1668b8[_0x47f6('0x17')]['message']);return _0x4212b8(_0x1668b8[_0x47f6('0x17')][_0x47f6('0x19')]);}logger[_0x47f6('0x17')]('CmContact,\x20%s,\x20%s',_0x4f0e83,_0x1668b8[_0x47f6('0x17')][_0x47f6('0x19')]);return _0x9d3210(_0x1668b8[_0x47f6('0x17')][_0x47f6('0x19')]);}else{logger['info']('CmContact,\x20%s,\x20%s',_0x4f0e83,_0x47f6('0x14'));_0x9d3210(_0x1668b8[_0x47f6('0x1a')][_0x47f6('0x19')]);}})[_0x47f6('0x1b')](function(_0x470774){logger[_0x47f6('0x17')](_0x47f6('0x13'),_0x4f0e83,_0x470774);_0x4212b8(_0x470774);});});}exports[_0x47f6('0x1c')]=function(_0x22026f){var _0x559cbd=this;return new Promise(function(_0x2e39e2,_0x509fa9){return db[_0x47f6('0x1d')][_0x47f6('0x1e')]({'raw':_0x22026f[_0x47f6('0x1f')]?_0x22026f[_0x47f6('0x1f')][_0x47f6('0x20')]===undefined?!![]:![]:!![],'where':_0x22026f[_0x47f6('0x1f')]?_0x22026f[_0x47f6('0x1f')][_0x47f6('0x21')]||null:null,'attributes':_0x22026f[_0x47f6('0x1f')]?_0x22026f[_0x47f6('0x1f')]['attributes']||null:null,'include':_0x22026f[_0x47f6('0x1f')]?_0x22026f['options']['include']?_[_0x47f6('0x22')](_0x22026f[_0x47f6('0x1f')]['include'],function(_0x56fe33){return{'model':db[_0x56fe33['model']],'as':_0x56fe33['as'],'attributes':_0x56fe33[_0x47f6('0x23')],'include':_0x56fe33[_0x47f6('0x24')]?_[_0x47f6('0x22')](_0x56fe33[_0x47f6('0x24')],function(_0xe23b12){return{'model':db[_0xe23b12['model']],'as':_0xe23b12['as'],'attributes':_0xe23b12[_0x47f6('0x23')],'include':_0xe23b12[_0x47f6('0x24')]?_[_0x47f6('0x22')](_0xe23b12[_0x47f6('0x24')],function(_0x5e9bd0){return{'model':db[_0x5e9bd0['model']],'as':_0x5e9bd0['as'],'attributes':_0x5e9bd0[_0x47f6('0x23')]};}):[]};}):[]};}):[]:[]})[_0x47f6('0x11')](function(_0x2b430e){logger[_0x47f6('0x12')](_0x47f6('0x1c'),_0x22026f);logger['debug'](_0x47f6('0x1c'),_0x22026f,JSON[_0x47f6('0x16')](_0x2b430e));_0x2e39e2(_0x2b430e);})['catch'](function(_0x58ce92){logger[_0x47f6('0x17')]('ShowCmContact',_0x58ce92[_0x47f6('0x19')],_0x22026f);_0x509fa9(_0x559cbd['error'](0x1f4,_0x58ce92[_0x47f6('0x19')]));});});};exports[_0x47f6('0x25')]=function(_0x5b8056){var _0x56c641=this;return new Promise(function(_0x50892a,_0x626edf){return db[_0x47f6('0x1d')][_0x47f6('0x26')](_0x5b8056[_0x47f6('0x27')],{'raw':_0x5b8056[_0x47f6('0x1f')]?_0x5b8056[_0x47f6('0x1f')][_0x47f6('0x20')]===undefined?!![]:![]:!![]})[_0x47f6('0x11')](function(_0xba0d2d){logger['info']('CreateCmContact',_0x5b8056);logger[_0x47f6('0x15')](_0x47f6('0x25'),_0x5b8056,JSON[_0x47f6('0x16')](_0xba0d2d));_0x50892a(_0xba0d2d);})[_0x47f6('0x1b')](function(_0x270e2c){logger['error'](_0x47f6('0x25'),_0x270e2c[_0x47f6('0x19')],_0x5b8056);_0x626edf(_0x56c641['error'](0x1f4,_0x270e2c[_0x47f6('0x19')]));});});};
\ No newline at end of file
+var _0x515f=['find','options','raw','where','attributes','include','map','model','debug','stringify','catch','CmContact','create','body','CreateCmContact','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','./cmContact.socket','register','then','info','CmContact,\x20%s,\x20%s','request\x20sent','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowCmContact'];(function(_0x352c13,_0x1a91cb){var _0x5b48e8=function(_0x1afcc2){while(--_0x1afcc2){_0x352c13['push'](_0x352c13['shift']());}};_0x5b48e8(++_0x1a91cb);}(_0x515f,0x147));var _0xf515=function(_0x20c5cd,_0x11d0c2){_0x20c5cd=_0x20c5cd-0x0;var _0x1788c9=_0x515f[_0x20c5cd];return _0x1788c9;};'use strict';var _=require(_0xf515('0x0'));var util=require(_0xf515('0x1'));var moment=require(_0xf515('0x2'));var BPromise=require(_0xf515('0x3'));var rs=require(_0xf515('0x4'));var fs=require('fs');var Redis=require(_0xf515('0x5'));var db=require(_0xf515('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf515('0x7'))(_0xf515('0x8'));var config=require(_0xf515('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf515('0xa')]['http']({'port':0x232a});config[_0xf515('0xb')]=_['defaults'](config[_0xf515('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf515('0xb')]));require(_0xf515('0xc'))[_0xf515('0xd')](socket);function respondWithRpcPromise(_0x969cb2,_0x4c5da2,_0x16493f){return new BPromise(function(_0x3cbefa,_0x6399c){return client['request'](_0x969cb2,_0x16493f)[_0xf515('0xe')](function(_0x26a395){logger[_0xf515('0xf')](_0xf515('0x10'),_0x4c5da2,_0xf515('0x11'));logger['debug'](_0xf515('0x12'),_0x4c5da2,_0xf515('0x11'),JSON['stringify'](_0x26a395));if(_0x26a395[_0xf515('0x13')]){if(_0x26a395[_0xf515('0x13')][_0xf515('0x14')]===0x1f4){logger[_0xf515('0x13')]('CmContact,\x20%s,\x20%s',_0x4c5da2,_0x26a395['error'][_0xf515('0x15')]);return _0x6399c(_0x26a395[_0xf515('0x13')][_0xf515('0x15')]);}logger[_0xf515('0x13')](_0xf515('0x10'),_0x4c5da2,_0x26a395[_0xf515('0x13')][_0xf515('0x15')]);return _0x3cbefa(_0x26a395['error']['message']);}else{logger[_0xf515('0xf')](_0xf515('0x10'),_0x4c5da2,'request\x20sent');_0x3cbefa(_0x26a395[_0xf515('0x16')]['message']);}})['catch'](function(_0x24c641){logger['error'](_0xf515('0x10'),_0x4c5da2,_0x24c641);_0x6399c(_0x24c641);});});}exports[_0xf515('0x17')]=function(_0x3b3cb2){var _0x55a1fc=this;return new Promise(function(_0x5b3a9e,_0x2ddc99){return db['CmContact'][_0xf515('0x18')]({'raw':_0x3b3cb2[_0xf515('0x19')]?_0x3b3cb2[_0xf515('0x19')][_0xf515('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b3cb2[_0xf515('0x19')]?_0x3b3cb2[_0xf515('0x19')][_0xf515('0x1b')]||null:null,'attributes':_0x3b3cb2[_0xf515('0x19')]?_0x3b3cb2['options'][_0xf515('0x1c')]||null:null,'include':_0x3b3cb2[_0xf515('0x19')]?_0x3b3cb2[_0xf515('0x19')][_0xf515('0x1d')]?_[_0xf515('0x1e')](_0x3b3cb2[_0xf515('0x19')]['include'],function(_0x232c1f){return{'model':db[_0x232c1f[_0xf515('0x1f')]],'as':_0x232c1f['as'],'attributes':_0x232c1f['attributes'],'include':_0x232c1f['include']?_[_0xf515('0x1e')](_0x232c1f['include'],function(_0xfcab02){return{'model':db[_0xfcab02[_0xf515('0x1f')]],'as':_0xfcab02['as'],'attributes':_0xfcab02[_0xf515('0x1c')],'include':_0xfcab02['include']?_[_0xf515('0x1e')](_0xfcab02[_0xf515('0x1d')],function(_0x21b0b5){return{'model':db[_0x21b0b5['model']],'as':_0x21b0b5['as'],'attributes':_0x21b0b5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x533068){logger[_0xf515('0xf')](_0xf515('0x17'),_0x3b3cb2);logger[_0xf515('0x20')](_0xf515('0x17'),_0x3b3cb2,JSON[_0xf515('0x21')](_0x533068));_0x5b3a9e(_0x533068);})[_0xf515('0x22')](function(_0x299982){logger[_0xf515('0x13')](_0xf515('0x17'),_0x299982[_0xf515('0x15')],_0x3b3cb2);_0x2ddc99(_0x55a1fc['error'](0x1f4,_0x299982[_0xf515('0x15')]));});});};exports['CreateCmContact']=function(_0x4c30d9){var _0x890758=this;return new Promise(function(_0x401a10,_0x581267){return db[_0xf515('0x23')][_0xf515('0x24')](_0x4c30d9[_0xf515('0x25')],{'raw':_0x4c30d9[_0xf515('0x19')]?_0x4c30d9[_0xf515('0x19')][_0xf515('0x1a')]===undefined?!![]:![]:!![]})[_0xf515('0xe')](function(_0x5ad794){logger[_0xf515('0xf')]('CreateCmContact',_0x4c30d9);logger[_0xf515('0x20')](_0xf515('0x26'),_0x4c30d9,JSON['stringify'](_0x5ad794));_0x401a10(_0x5ad794);})[_0xf515('0x22')](function(_0x349a6a){logger[_0xf515('0x13')]('CreateCmContact',_0x349a6a[_0xf515('0x15')],_0x4c30d9);_0x581267(_0x890758[_0xf515('0x13')](0x1f4,_0x349a6a[_0xf515('0x15')]));});});};
\ No newline at end of file