Built motion from commit 42801a18.|2.6.28
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index 8bdc64a..57622ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08da=['request','info','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxInteraction,\x20%s,\x20%s','request\x20sent','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToFaxInteraction','addTags','ids','AddTags','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register'];(function(_0x4ce144,_0x15255e){var _0x1da279=function(_0x464cad){while(--_0x464cad){_0x4ce144['push'](_0x4ce144['shift']());}};_0x1da279(++_0x15255e);}(_0x08da,0x194));var _0xa08d=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x08da[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xa08d('0x0'));var util=require('util');var moment=require(_0xa08d('0x1'));var BPromise=require(_0xa08d('0x2'));var rs=require(_0xa08d('0x3'));var fs=require('fs');var Redis=require(_0xa08d('0x4'));var db=require(_0xa08d('0x5'))['db'];var utils=require(_0xa08d('0x6'));var logger=require('../../config/logger')(_0xa08d('0x7'));var config=require('../../config/environment');var jayson=require(_0xa08d('0x8'));var client=jayson[_0xa08d('0x9')]['http']({'port':0x232a});config['redis']=_[_0xa08d('0xa')](config[_0xa08d('0xb')],{'host':_0xa08d('0xc'),'port':0x18eb});var socket=require(_0xa08d('0xd'))(new Redis(config[_0xa08d('0xb')]));require(_0xa08d('0xe'))[_0xa08d('0xf')](socket);function respondWithRpcPromise(_0x72491b,_0x267735,_0x4d22ce){return new BPromise(function(_0x5c3bc1,_0x490101){return client[_0xa08d('0x10')](_0x72491b,_0x4d22ce)['then'](function(_0x16957b){logger[_0xa08d('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x267735,'request\x20sent');logger['debug'](_0xa08d('0x12'),_0x267735,'request\x20sent',JSON[_0xa08d('0x13')](_0x16957b));if(_0x16957b[_0xa08d('0x14')]){if(_0x16957b['error'][_0xa08d('0x15')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x267735,_0x16957b[_0xa08d('0x14')][_0xa08d('0x16')]);return _0x490101(_0x16957b[_0xa08d('0x14')]['message']);}logger['error'](_0xa08d('0x17'),_0x267735,_0x16957b[_0xa08d('0x14')]['message']);return _0x5c3bc1(_0x16957b[_0xa08d('0x14')][_0xa08d('0x16')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x267735,_0xa08d('0x18'));_0x5c3bc1(_0x16957b[_0xa08d('0x19')]['message']);}})[_0xa08d('0x1a')](function(_0x40009e){logger[_0xa08d('0x14')](_0xa08d('0x17'),_0x267735,_0x40009e);_0x490101(_0x40009e);});});}exports[_0xa08d('0x1b')]=function(_0x12577c){var _0x2b2171=this;return new Promise(function(_0x5e388a,_0x1f2fc8){return db[_0xa08d('0x1c')][_0xa08d('0x1d')](_0x12577c[_0xa08d('0x1e')],{'raw':_0x12577c[_0xa08d('0x1f')]?_0x12577c['options'][_0xa08d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12577c[_0xa08d('0x1f')]?_0x12577c['options'][_0xa08d('0x21')]||null:null,'attributes':_0x12577c['options']?_0x12577c[_0xa08d('0x1f')][_0xa08d('0x22')]||null:null,'limit':_0x12577c[_0xa08d('0x1f')]?_0x12577c[_0xa08d('0x1f')][_0xa08d('0x23')]||null:null})[_0xa08d('0x24')](function(_0xcb50b1){logger[_0xa08d('0x11')](_0xa08d('0x1b'),_0x12577c);logger['debug']('UpdateFaxInteraction',_0x12577c,JSON[_0xa08d('0x13')](_0xcb50b1));_0x5e388a(_0xcb50b1);})['catch'](function(_0x2e067e){logger[_0xa08d('0x14')](_0xa08d('0x1b'),_0x2e067e[_0xa08d('0x16')],_0x12577c);_0x1f2fc8(_0x2b2171[_0xa08d('0x14')](0x1f4,_0x2e067e[_0xa08d('0x16')]));});});};exports[_0xa08d('0x25')]=function(_0x13227b){return new Promise(function(_0x2a4b7a,_0x538a26){return db[_0xa08d('0x1c')]['find']({'where':_0x13227b['options']?_0x13227b[_0xa08d('0x1f')]['where']||null:null})[_0xa08d('0x24')](function(_0x135594){if(_0x135594){return _0x135594[_0xa08d('0x26')](_0x13227b[_0xa08d('0x1e')][_0xa08d('0x27')],_['omit'](_0x13227b['body'],[_0xa08d('0x27'),'id'])||{});}})['spread'](function(_0x1076b5){logger['info'](_0xa08d('0x28'),_0x13227b);logger[_0xa08d('0x29')](_0xa08d('0x28'),_0x13227b,JSON[_0xa08d('0x13')](_0x1076b5));_0x2a4b7a(_0x1076b5);})[_0xa08d('0x1a')](function(_0x3cffd3){logger['error']('AddTags',_0x3cffd3[_0xa08d('0x16')],_0x13227b);_0x538a26(_this[_0xa08d('0x14')](0x1f4,_0x3cffd3[_0xa08d('0x16')]));});});};
\ No newline at end of file
+var _0xb0fb=['../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','then','info','FaxInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','FaxInteraction','update','options','where','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','body','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x271ace,_0x2b1999){var _0x48e6af=function(_0x166e5c){while(--_0x166e5c){_0x271ace['push'](_0x271ace['shift']());}};_0x48e6af(++_0x2b1999);}(_0xb0fb,0x127));var _0xbb0f=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xb0fb[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xbb0f('0x0'));var util=require(_0xbb0f('0x1'));var moment=require(_0xbb0f('0x2'));var BPromise=require(_0xbb0f('0x3'));var rs=require(_0xbb0f('0x4'));var fs=require('fs');var Redis=require(_0xbb0f('0x5'));var db=require(_0xbb0f('0x6'))['db'];var utils=require(_0xbb0f('0x7'));var logger=require(_0xbb0f('0x8'))('rpc');var config=require(_0xbb0f('0x9'));var jayson=require(_0xbb0f('0xa'));var client=jayson['client'][_0xbb0f('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbb0f('0xc')],{'host':_0xbb0f('0xd'),'port':0x18eb});var socket=require(_0xbb0f('0xe'))(new Redis(config[_0xbb0f('0xc')]));require('./faxInteraction.socket')[_0xbb0f('0xf')](socket);function respondWithRpcPromise(_0x3575af,_0x19a244,_0x4fb270){return new BPromise(function(_0x451cdb,_0x22c2a8){return client['request'](_0x3575af,_0x4fb270)[_0xbb0f('0x10')](function(_0x39dcd1){logger[_0xbb0f('0x11')](_0xbb0f('0x12'),_0x19a244,'request\x20sent');logger[_0xbb0f('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x19a244,_0xbb0f('0x14'),JSON[_0xbb0f('0x15')](_0x39dcd1));if(_0x39dcd1[_0xbb0f('0x16')]){if(_0x39dcd1[_0xbb0f('0x16')][_0xbb0f('0x17')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x19a244,_0x39dcd1[_0xbb0f('0x16')][_0xbb0f('0x18')]);return _0x22c2a8(_0x39dcd1[_0xbb0f('0x16')][_0xbb0f('0x18')]);}logger[_0xbb0f('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x19a244,_0x39dcd1[_0xbb0f('0x16')]['message']);return _0x451cdb(_0x39dcd1[_0xbb0f('0x16')][_0xbb0f('0x18')]);}else{logger[_0xbb0f('0x11')](_0xbb0f('0x12'),_0x19a244,_0xbb0f('0x14'));_0x451cdb(_0x39dcd1[_0xbb0f('0x19')]['message']);}})[_0xbb0f('0x1a')](function(_0x5daa9b){logger[_0xbb0f('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x19a244,_0x5daa9b);_0x22c2a8(_0x5daa9b);});});}exports['UpdateFaxInteraction']=function(_0x4c82ef){var _0x5b06c7=this;return new Promise(function(_0x1f7d5a,_0x2d63f5){return db[_0xbb0f('0x1b')][_0xbb0f('0x1c')](_0x4c82ef['body'],{'raw':_0x4c82ef[_0xbb0f('0x1d')]?_0x4c82ef['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c82ef[_0xbb0f('0x1d')]?_0x4c82ef[_0xbb0f('0x1d')][_0xbb0f('0x1e')]||null:null,'attributes':_0x4c82ef[_0xbb0f('0x1d')]?_0x4c82ef[_0xbb0f('0x1d')][_0xbb0f('0x1f')]||null:null,'limit':_0x4c82ef[_0xbb0f('0x1d')]?_0x4c82ef['options'][_0xbb0f('0x20')]||null:null})[_0xbb0f('0x10')](function(_0x5bd769){logger[_0xbb0f('0x11')](_0xbb0f('0x21'),_0x4c82ef);logger['debug'](_0xbb0f('0x21'),_0x4c82ef,JSON[_0xbb0f('0x15')](_0x5bd769));_0x1f7d5a(_0x5bd769);})[_0xbb0f('0x1a')](function(_0xb46090){logger[_0xbb0f('0x16')](_0xbb0f('0x21'),_0xb46090[_0xbb0f('0x18')],_0x4c82ef);_0x2d63f5(_0x5b06c7['error'](0x1f4,_0xb46090[_0xbb0f('0x18')]));});});};exports[_0xbb0f('0x22')]=function(_0x4ac16b){return new Promise(function(_0x4a5c0d,_0x2e62d5){return db[_0xbb0f('0x1b')]['find']({'where':_0x4ac16b[_0xbb0f('0x1d')]?_0x4ac16b[_0xbb0f('0x1d')]['where']||null:null})['then'](function(_0x42f128){if(_0x42f128){return _0x42f128['addTags'](_0x4ac16b[_0xbb0f('0x23')][_0xbb0f('0x24')],_['omit'](_0x4ac16b[_0xbb0f('0x23')],[_0xbb0f('0x24'),'id'])||{});}})['spread'](function(_0x554ba5){logger['info'](_0xbb0f('0x25'),_0x4ac16b);logger[_0xbb0f('0x13')](_0xbb0f('0x25'),_0x4ac16b,JSON[_0xbb0f('0x15')](_0x554ba5));_0x4a5c0d(_0x554ba5);})['catch'](function(_0x1866ac){logger['error']('AddTags',_0x1866ac[_0xbb0f('0x18')],_0x4ac16b);_0x2e62d5(_this[_0xbb0f('0x16')](0x1f4,_0x1866ac[_0xbb0f('0x18')]));});});};
\ No newline at end of file