Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index 9e4d768..3ea3077 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x281a=['AddTagsToFaxInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','where','attributes','limit','stringify'];(function(_0x43a45e,_0x4f9fca){var _0x1058f5=function(_0x1f4ba9){while(--_0x1f4ba9){_0x43a45e['push'](_0x43a45e['shift']());}};_0x1058f5(++_0x4f9fca);}(_0x281a,0xa6));var _0xa281=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x281a[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require(_0xa281('0x0'));var moment=require(_0xa281('0x1'));var BPromise=require(_0xa281('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa281('0x3'));var db=require(_0xa281('0x4'))['db'];var utils=require(_0xa281('0x5'));var logger=require(_0xa281('0x6'))(_0xa281('0x7'));var config=require(_0xa281('0x8'));var jayson=require(_0xa281('0x9'));var client=jayson['client'][_0xa281('0xa')]({'port':0x232a});config[_0xa281('0xb')]=_[_0xa281('0xc')](config[_0xa281('0xb')],{'host':_0xa281('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa281('0xb')]));require('./faxInteraction.socket')[_0xa281('0xe')](socket);function respondWithRpcPromise(_0x5e35f2,_0x2f5575,_0x48d052){return new BPromise(function(_0x26e694,_0x5e0111){return client[_0xa281('0xf')](_0x5e35f2,_0x48d052)[_0xa281('0x10')](function(_0x390622){logger[_0xa281('0x11')](_0xa281('0x12'),_0x2f5575,_0xa281('0x13'));logger['debug'](_0xa281('0x14'),_0x2f5575,_0xa281('0x13'),JSON['stringify'](_0x390622));if(_0x390622[_0xa281('0x15')]){if(_0x390622[_0xa281('0x15')][_0xa281('0x16')]===0x1f4){logger[_0xa281('0x15')](_0xa281('0x12'),_0x2f5575,_0x390622['error']['message']);return _0x5e0111(_0x390622[_0xa281('0x15')][_0xa281('0x17')]);}logger[_0xa281('0x15')](_0xa281('0x12'),_0x2f5575,_0x390622[_0xa281('0x15')][_0xa281('0x17')]);return _0x26e694(_0x390622[_0xa281('0x15')][_0xa281('0x17')]);}else{logger[_0xa281('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x2f5575,_0xa281('0x13'));_0x26e694(_0x390622[_0xa281('0x18')][_0xa281('0x17')]);}})[_0xa281('0x19')](function(_0x4e9fc2){logger[_0xa281('0x15')](_0xa281('0x12'),_0x2f5575,_0x4e9fc2);_0x5e0111(_0x4e9fc2);});});}exports[_0xa281('0x1a')]=function(_0x1c0686){var _0x4c1e99=this;return new Promise(function(_0x1a3f1a,_0x5d04c2){return db[_0xa281('0x1b')]['update'](_0x1c0686[_0xa281('0x1c')],{'raw':_0x1c0686[_0xa281('0x1d')]?_0x1c0686[_0xa281('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c0686[_0xa281('0x1d')]?_0x1c0686[_0xa281('0x1d')][_0xa281('0x1e')]||null:null,'attributes':_0x1c0686['options']?_0x1c0686[_0xa281('0x1d')][_0xa281('0x1f')]||null:null,'limit':_0x1c0686[_0xa281('0x1d')]?_0x1c0686[_0xa281('0x1d')][_0xa281('0x20')]||null:null})[_0xa281('0x10')](function(_0x17e90c){logger[_0xa281('0x11')](_0xa281('0x1a'),_0x1c0686);logger['debug'](_0xa281('0x1a'),_0x1c0686,JSON[_0xa281('0x21')](_0x17e90c));_0x1a3f1a(_0x17e90c);})['catch'](function(_0x388c1d){logger[_0xa281('0x15')](_0xa281('0x1a'),_0x388c1d[_0xa281('0x17')],_0x1c0686);_0x5d04c2(_0x4c1e99[_0xa281('0x15')](0x1f4,_0x388c1d[_0xa281('0x17')]));});});};exports[_0xa281('0x22')]=function(_0x1f2a50){return new Promise(function(_0x52d5e3,_0x35b297){return db[_0xa281('0x1b')]['find']({'where':_0x1f2a50[_0xa281('0x1d')]?_0x1f2a50[_0xa281('0x1d')][_0xa281('0x1e')]||null:null})[_0xa281('0x10')](function(_0x112ac6){if(_0x112ac6){return _0x112ac6[_0xa281('0x23')](_0x1f2a50['body'][_0xa281('0x24')],_[_0xa281('0x25')](_0x1f2a50[_0xa281('0x1c')],[_0xa281('0x24'),'id'])||{});}})[_0xa281('0x26')](function(_0x5c0b43){logger[_0xa281('0x11')]('AddTags',_0x1f2a50);logger['debug'](_0xa281('0x27'),_0x1f2a50,JSON[_0xa281('0x21')](_0x5c0b43));_0x52d5e3(_0x5c0b43);})[_0xa281('0x19')](function(_0x36ccd5){logger['error'](_0xa281('0x27'),_0x36ccd5[_0xa281('0x17')],_0x1f2a50);_0x35b297(_this['error'](0x1f4,_0x36ccd5[_0xa281('0x17')]));});});};
\ No newline at end of file
+var _0x2856=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateFaxInteraction','update','body','options','where','limit','debug','stringify','catch','FaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x112411,_0x5b32a2){var _0x4ccd23=function(_0x19471f){while(--_0x19471f){_0x112411['push'](_0x112411['shift']());}};_0x4ccd23(++_0x5b32a2);}(_0x2856,0x1ce));var _0x6285=function(_0x78a8f4,_0x259809){_0x78a8f4=_0x78a8f4-0x0;var _0x2b3291=_0x2856[_0x78a8f4];return _0x2b3291;};'use strict';var _=require(_0x6285('0x0'));var util=require(_0x6285('0x1'));var moment=require(_0x6285('0x2'));var BPromise=require(_0x6285('0x3'));var rs=require(_0x6285('0x4'));var fs=require('fs');var Redis=require(_0x6285('0x5'));var db=require(_0x6285('0x6'))['db'];var utils=require(_0x6285('0x7'));var logger=require(_0x6285('0x8'))(_0x6285('0x9'));var config=require(_0x6285('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6285('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6285('0xc'),'port':0x18eb});var socket=require(_0x6285('0xd'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x6285('0xe')](socket);function respondWithRpcPromise(_0x589e1b,_0x3d49d7,_0x4e35e2){return new BPromise(function(_0x521358,_0x2dddad){return client[_0x6285('0xf')](_0x589e1b,_0x4e35e2)[_0x6285('0x10')](function(_0x158116){logger[_0x6285('0x11')](_0x6285('0x12'),_0x3d49d7,_0x6285('0x13'));logger['debug'](_0x6285('0x14'),_0x3d49d7,_0x6285('0x13'),JSON['stringify'](_0x158116));if(_0x158116['error']){if(_0x158116[_0x6285('0x15')][_0x6285('0x16')]===0x1f4){logger['error'](_0x6285('0x12'),_0x3d49d7,_0x158116[_0x6285('0x15')][_0x6285('0x17')]);return _0x2dddad(_0x158116['error'][_0x6285('0x17')]);}logger[_0x6285('0x15')](_0x6285('0x12'),_0x3d49d7,_0x158116['error'][_0x6285('0x17')]);return _0x521358(_0x158116[_0x6285('0x15')]['message']);}else{logger[_0x6285('0x11')](_0x6285('0x12'),_0x3d49d7,'request\x20sent');_0x521358(_0x158116['result'][_0x6285('0x17')]);}})['catch'](function(_0x3ee0ee){logger[_0x6285('0x15')](_0x6285('0x12'),_0x3d49d7,_0x3ee0ee);_0x2dddad(_0x3ee0ee);});});}exports[_0x6285('0x18')]=function(_0x197252){var _0xcbcddd=this;return new Promise(function(_0x4d60df,_0x5ef08c){return db['FaxInteraction'][_0x6285('0x19')](_0x197252[_0x6285('0x1a')],{'raw':_0x197252['options']?_0x197252[_0x6285('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x197252['options']?_0x197252[_0x6285('0x1b')][_0x6285('0x1c')]||null:null,'attributes':_0x197252['options']?_0x197252[_0x6285('0x1b')]['attributes']||null:null,'limit':_0x197252[_0x6285('0x1b')]?_0x197252[_0x6285('0x1b')][_0x6285('0x1d')]||null:null})[_0x6285('0x10')](function(_0x2eae68){logger[_0x6285('0x11')](_0x6285('0x18'),_0x197252);logger[_0x6285('0x1e')](_0x6285('0x18'),_0x197252,JSON[_0x6285('0x1f')](_0x2eae68));_0x4d60df(_0x2eae68);})[_0x6285('0x20')](function(_0x469118){logger[_0x6285('0x15')](_0x6285('0x18'),_0x469118[_0x6285('0x17')],_0x197252);_0x5ef08c(_0xcbcddd[_0x6285('0x15')](0x1f4,_0x469118[_0x6285('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x470e2b){return new Promise(function(_0x31d6f5,_0x539393){return db[_0x6285('0x21')][_0x6285('0x22')]({'where':_0x470e2b[_0x6285('0x1b')]?_0x470e2b[_0x6285('0x1b')][_0x6285('0x1c')]||null:null})[_0x6285('0x10')](function(_0x5bbf9c){if(_0x5bbf9c){return _0x5bbf9c[_0x6285('0x23')](_0x470e2b[_0x6285('0x1a')][_0x6285('0x24')],_[_0x6285('0x25')](_0x470e2b[_0x6285('0x1a')],[_0x6285('0x24'),'id'])||{});}})['spread'](function(_0x397435){logger[_0x6285('0x11')](_0x6285('0x26'),_0x470e2b);logger[_0x6285('0x1e')]('AddTags',_0x470e2b,JSON[_0x6285('0x1f')](_0x397435));_0x31d6f5(_0x397435);})[_0x6285('0x20')](function(_0x3cc37e){logger[_0x6285('0x15')]('AddTags',_0x3cc37e[_0x6285('0x17')],_0x470e2b);_0x539393(_this[_0x6285('0x15')](0x1f4,_0x3cc37e[_0x6285('0x17')]));});});};
\ No newline at end of file