Built motion from commit 42801a18.|2.6.28
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index 7ae2374..093b803 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf52b=['./faxInteraction.socket','register','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateFaxInteraction','FaxInteraction','options','raw','where','attributes','limit','then','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0xf52b,0xc8));var _0xbf52=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0xf52b[_0x40d8d7];return _0x3454cc;};'use strict';var _=require(_0xbf52('0x0'));var util=require(_0xbf52('0x1'));var moment=require('moment');var BPromise=require(_0xbf52('0x2'));var rs=require(_0xbf52('0x3'));var fs=require('fs');var Redis=require(_0xbf52('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf52('0x5'));var logger=require(_0xbf52('0x6'))(_0xbf52('0x7'));var config=require('../../config/environment');var jayson=require(_0xbf52('0x8'));var client=jayson[_0xbf52('0x9')][_0xbf52('0xa')]({'port':0x232a});config[_0xbf52('0xb')]=_[_0xbf52('0xc')](config[_0xbf52('0xb')],{'host':_0xbf52('0xd'),'port':0x18eb});var socket=require(_0xbf52('0xe'))(new Redis(config[_0xbf52('0xb')]));require(_0xbf52('0xf'))[_0xbf52('0x10')](socket);function respondWithRpcPromise(_0x2f11be,_0x562df7,_0x18a90f){return new BPromise(function(_0x2f0060,_0x103a93){return client['request'](_0x2f11be,_0x18a90f)['then'](function(_0x567a71){logger[_0xbf52('0x11')](_0xbf52('0x12'),_0x562df7,'request\x20sent');logger[_0xbf52('0x13')](_0xbf52('0x14'),_0x562df7,_0xbf52('0x15'),JSON[_0xbf52('0x16')](_0x567a71));if(_0x567a71[_0xbf52('0x17')]){if(_0x567a71[_0xbf52('0x17')]['code']===0x1f4){logger[_0xbf52('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x562df7,_0x567a71[_0xbf52('0x17')]['message']);return _0x103a93(_0x567a71[_0xbf52('0x17')][_0xbf52('0x18')]);}logger[_0xbf52('0x17')](_0xbf52('0x12'),_0x562df7,_0x567a71['error'][_0xbf52('0x18')]);return _0x2f0060(_0x567a71[_0xbf52('0x17')][_0xbf52('0x18')]);}else{logger[_0xbf52('0x11')](_0xbf52('0x12'),_0x562df7,_0xbf52('0x15'));_0x2f0060(_0x567a71[_0xbf52('0x19')][_0xbf52('0x18')]);}})['catch'](function(_0x58aada){logger['error'](_0xbf52('0x12'),_0x562df7,_0x58aada);_0x103a93(_0x58aada);});});}exports[_0xbf52('0x1a')]=function(_0x363c84){var _0x15df81=this;return new Promise(function(_0x1df7d9,_0x2f53ea){return db[_0xbf52('0x1b')]['update'](_0x363c84['body'],{'raw':_0x363c84[_0xbf52('0x1c')]?_0x363c84[_0xbf52('0x1c')][_0xbf52('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x363c84[_0xbf52('0x1c')]?_0x363c84[_0xbf52('0x1c')][_0xbf52('0x1e')]||null:null,'attributes':_0x363c84['options']?_0x363c84[_0xbf52('0x1c')][_0xbf52('0x1f')]||null:null,'limit':_0x363c84['options']?_0x363c84[_0xbf52('0x1c')][_0xbf52('0x20')]||null:null})[_0xbf52('0x21')](function(_0x5338d5){logger[_0xbf52('0x11')](_0xbf52('0x1a'),_0x363c84);logger[_0xbf52('0x13')](_0xbf52('0x1a'),_0x363c84,JSON[_0xbf52('0x16')](_0x5338d5));_0x1df7d9(_0x5338d5);})[_0xbf52('0x22')](function(_0x1487dc){logger['error'](_0xbf52('0x1a'),_0x1487dc[_0xbf52('0x18')],_0x363c84);_0x2f53ea(_0x15df81[_0xbf52('0x17')](0x1f4,_0x1487dc[_0xbf52('0x18')]));});});};exports[_0xbf52('0x23')]=function(_0x258843){return new Promise(function(_0x2c59be,_0x2906f5){return db[_0xbf52('0x1b')][_0xbf52('0x24')]({'where':_0x258843['options']?_0x258843[_0xbf52('0x1c')]['where']||null:null})[_0xbf52('0x21')](function(_0x8f9e70){if(_0x8f9e70){return _0x8f9e70[_0xbf52('0x25')](_0x258843['body'][_0xbf52('0x26')],_[_0xbf52('0x27')](_0x258843[_0xbf52('0x28')],[_0xbf52('0x26'),'id'])||{});}})[_0xbf52('0x29')](function(_0x4c05cb){logger[_0xbf52('0x11')](_0xbf52('0x2a'),_0x258843);logger[_0xbf52('0x13')](_0xbf52('0x2a'),_0x258843,JSON[_0xbf52('0x16')](_0x4c05cb));_0x2c59be(_0x4c05cb);})[_0xbf52('0x22')](function(_0x3232da){logger[_0xbf52('0x17')]('AddTags',_0x3232da[_0xbf52('0x18')],_0x258843);_0x2906f5(_this['error'](0x1f4,_0x3232da[_0xbf52('0x18')]));});});};
\ No newline at end of file
+var _0x2b0b=['AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','omit','spread'];(function(_0x479131,_0x2828f4){var _0x28e996=function(_0xc3890d){while(--_0xc3890d){_0x479131['push'](_0x479131['shift']());}};_0x28e996(++_0x2828f4);}(_0x2b0b,0x79));var _0xb2b0=function(_0x4f00f9,_0x3b903d){_0x4f00f9=_0x4f00f9-0x0;var _0x51c2d8=_0x2b0b[_0x4f00f9];return _0x51c2d8;};'use strict';var _=require(_0xb2b0('0x0'));var util=require(_0xb2b0('0x1'));var moment=require(_0xb2b0('0x2'));var BPromise=require(_0xb2b0('0x3'));var rs=require(_0xb2b0('0x4'));var fs=require('fs');var Redis=require(_0xb2b0('0x5'));var db=require(_0xb2b0('0x6'))['db'];var utils=require(_0xb2b0('0x7'));var logger=require(_0xb2b0('0x8'))(_0xb2b0('0x9'));var config=require(_0xb2b0('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb2b0('0xb')]['http']({'port':0x232a});config[_0xb2b0('0xc')]=_[_0xb2b0('0xd')](config[_0xb2b0('0xc')],{'host':_0xb2b0('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxInteraction.socket')[_0xb2b0('0xf')](socket);function respondWithRpcPromise(_0x5ed5a8,_0x3c6e2b,_0x157a18){return new BPromise(function(_0xdb8f5e,_0x171284){return client['request'](_0x5ed5a8,_0x157a18)[_0xb2b0('0x10')](function(_0x1f3059){logger[_0xb2b0('0x11')](_0xb2b0('0x12'),_0x3c6e2b,_0xb2b0('0x13'));logger[_0xb2b0('0x14')](_0xb2b0('0x15'),_0x3c6e2b,_0xb2b0('0x13'),JSON[_0xb2b0('0x16')](_0x1f3059));if(_0x1f3059[_0xb2b0('0x17')]){if(_0x1f3059['error']['code']===0x1f4){logger[_0xb2b0('0x17')](_0xb2b0('0x12'),_0x3c6e2b,_0x1f3059[_0xb2b0('0x17')][_0xb2b0('0x18')]);return _0x171284(_0x1f3059[_0xb2b0('0x17')][_0xb2b0('0x18')]);}logger[_0xb2b0('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x3c6e2b,_0x1f3059[_0xb2b0('0x17')][_0xb2b0('0x18')]);return _0xdb8f5e(_0x1f3059[_0xb2b0('0x17')]['message']);}else{logger[_0xb2b0('0x11')](_0xb2b0('0x12'),_0x3c6e2b,'request\x20sent');_0xdb8f5e(_0x1f3059['result'][_0xb2b0('0x18')]);}})[_0xb2b0('0x19')](function(_0x16b969){logger[_0xb2b0('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x3c6e2b,_0x16b969);_0x171284(_0x16b969);});});}exports[_0xb2b0('0x1a')]=function(_0x3c081f){var _0x5e6a9c=this;return new Promise(function(_0x335f46,_0x743ea6){return db[_0xb2b0('0x1b')][_0xb2b0('0x1c')](_0x3c081f[_0xb2b0('0x1d')],{'raw':_0x3c081f[_0xb2b0('0x1e')]?_0x3c081f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c081f[_0xb2b0('0x1e')]?_0x3c081f[_0xb2b0('0x1e')][_0xb2b0('0x1f')]||null:null,'attributes':_0x3c081f[_0xb2b0('0x1e')]?_0x3c081f[_0xb2b0('0x1e')][_0xb2b0('0x20')]||null:null,'limit':_0x3c081f['options']?_0x3c081f['options'][_0xb2b0('0x21')]||null:null})[_0xb2b0('0x10')](function(_0x3ec851){logger[_0xb2b0('0x11')]('UpdateFaxInteraction',_0x3c081f);logger[_0xb2b0('0x14')](_0xb2b0('0x1a'),_0x3c081f,JSON[_0xb2b0('0x16')](_0x3ec851));_0x335f46(_0x3ec851);})['catch'](function(_0x4a5e0a){logger[_0xb2b0('0x17')](_0xb2b0('0x1a'),_0x4a5e0a[_0xb2b0('0x18')],_0x3c081f);_0x743ea6(_0x5e6a9c[_0xb2b0('0x17')](0x1f4,_0x4a5e0a['message']));});});};exports[_0xb2b0('0x22')]=function(_0x5dbd99){return new Promise(function(_0x4b7e89,_0x186330){return db[_0xb2b0('0x1b')][_0xb2b0('0x23')]({'where':_0x5dbd99[_0xb2b0('0x1e')]?_0x5dbd99['options'][_0xb2b0('0x1f')]||null:null})[_0xb2b0('0x10')](function(_0x2a8d64){if(_0x2a8d64){return _0x2a8d64[_0xb2b0('0x24')](_0x5dbd99[_0xb2b0('0x1d')]['ids'],_[_0xb2b0('0x25')](_0x5dbd99[_0xb2b0('0x1d')],['ids','id'])||{});}})[_0xb2b0('0x26')](function(_0xfa7a1){logger[_0xb2b0('0x11')](_0xb2b0('0x27'),_0x5dbd99);logger[_0xb2b0('0x14')](_0xb2b0('0x27'),_0x5dbd99,JSON[_0xb2b0('0x16')](_0xfa7a1));_0x4b7e89(_0xfa7a1);})[_0xb2b0('0x19')](function(_0xb0eef5){logger[_0xb2b0('0x17')](_0xb2b0('0x27'),_0xb0eef5[_0xb2b0('0x18')],_0x5dbd99);_0x186330(_this['error'](0x1f4,_0xb0eef5['message']));});});};
\ No newline at end of file