Built motion from commit 746c7d2a.|2.5.35
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index 8dbf4f1..ca7a75d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd0b=['catch','AddTagsToFaxInteraction','find','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','debug'];(function(_0x3bfe87,_0x5db6d9){var _0x40a2db=function(_0x53a208){while(--_0x53a208){_0x3bfe87['push'](_0x3bfe87['shift']());}};_0x40a2db(++_0x5db6d9);}(_0xfd0b,0x1cb));var _0xbfd0=function(_0x5c41f5,_0xf1ff1a){_0x5c41f5=_0x5c41f5-0x0;var _0x213d67=_0xfd0b[_0x5c41f5];return _0x213d67;};'use strict';var _=require(_0xbfd0('0x0'));var util=require(_0xbfd0('0x1'));var moment=require(_0xbfd0('0x2'));var BPromise=require(_0xbfd0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfd0('0x4'));var db=require(_0xbfd0('0x5'))['db'];var utils=require(_0xbfd0('0x6'));var logger=require(_0xbfd0('0x7'))(_0xbfd0('0x8'));var config=require(_0xbfd0('0x9'));var jayson=require(_0xbfd0('0xa'));var client=jayson[_0xbfd0('0xb')][_0xbfd0('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xbfd0('0xd'),'port':0x18eb});var socket=require(_0xbfd0('0xe'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xbfd0('0xf')](socket);function respondWithRpcPromise(_0x31788e,_0x2eb8ec,_0x5ee5fd){return new BPromise(function(_0xb16f5f,_0x5c5912){return client[_0xbfd0('0x10')](_0x31788e,_0x5ee5fd)[_0xbfd0('0x11')](function(_0x3d6628){logger[_0xbfd0('0x12')](_0xbfd0('0x13'),_0x2eb8ec,'request\x20sent');logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x2eb8ec,_0xbfd0('0x14'),JSON[_0xbfd0('0x15')](_0x3d6628));if(_0x3d6628[_0xbfd0('0x16')]){if(_0x3d6628[_0xbfd0('0x16')]['code']===0x1f4){logger['error'](_0xbfd0('0x13'),_0x2eb8ec,_0x3d6628[_0xbfd0('0x16')][_0xbfd0('0x17')]);return _0x5c5912(_0x3d6628[_0xbfd0('0x16')][_0xbfd0('0x17')]);}logger[_0xbfd0('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x2eb8ec,_0x3d6628['error'][_0xbfd0('0x17')]);return _0xb16f5f(_0x3d6628['error'][_0xbfd0('0x17')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x2eb8ec,_0xbfd0('0x14'));_0xb16f5f(_0x3d6628[_0xbfd0('0x18')][_0xbfd0('0x17')]);}})['catch'](function(_0x1e074d){logger[_0xbfd0('0x16')](_0xbfd0('0x13'),_0x2eb8ec,_0x1e074d);_0x5c5912(_0x1e074d);});});}exports[_0xbfd0('0x19')]=function(_0x69512f){var _0x1f57ae=this;return new Promise(function(_0x54f852,_0x4be10b){return db[_0xbfd0('0x1a')][_0xbfd0('0x1b')](_0x69512f['body'],{'raw':_0x69512f[_0xbfd0('0x1c')]?_0x69512f[_0xbfd0('0x1c')][_0xbfd0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x69512f[_0xbfd0('0x1c')]?_0x69512f[_0xbfd0('0x1c')][_0xbfd0('0x1e')]||null:null,'attributes':_0x69512f[_0xbfd0('0x1c')]?_0x69512f[_0xbfd0('0x1c')][_0xbfd0('0x1f')]||null:null,'limit':_0x69512f[_0xbfd0('0x1c')]?_0x69512f[_0xbfd0('0x1c')]['limit']||null:null})[_0xbfd0('0x11')](function(_0x52106d){logger[_0xbfd0('0x12')](_0xbfd0('0x19'),_0x69512f);logger[_0xbfd0('0x20')](_0xbfd0('0x19'),_0x69512f,JSON['stringify'](_0x52106d));_0x54f852(_0x52106d);})[_0xbfd0('0x21')](function(_0xa4fe33){logger['error'](_0xbfd0('0x19'),_0xa4fe33[_0xbfd0('0x17')],_0x69512f);_0x4be10b(_0x1f57ae[_0xbfd0('0x16')](0x1f4,_0xa4fe33[_0xbfd0('0x17')]));});});};exports[_0xbfd0('0x22')]=function(_0x3ddbfc){return new Promise(function(_0x145b93,_0x2d5400){return db[_0xbfd0('0x1a')][_0xbfd0('0x23')]({'where':_0x3ddbfc['options']?_0x3ddbfc['options'][_0xbfd0('0x1e')]||null:null})[_0xbfd0('0x11')](function(_0x553d4f){if(_0x553d4f){return _0x553d4f[_0xbfd0('0x24')](_0x3ddbfc[_0xbfd0('0x25')][_0xbfd0('0x26')],_[_0xbfd0('0x27')](_0x3ddbfc[_0xbfd0('0x25')],['ids','id'])||{});}})['spread'](function(_0x12a26e){logger[_0xbfd0('0x12')](_0xbfd0('0x28'),_0x3ddbfc);logger[_0xbfd0('0x20')](_0xbfd0('0x28'),_0x3ddbfc,JSON[_0xbfd0('0x15')](_0x12a26e));_0x145b93(_0x12a26e);})[_0xbfd0('0x21')](function(_0x5dd79f){logger[_0xbfd0('0x16')](_0xbfd0('0x28'),_0x5dd79f[_0xbfd0('0x17')],_0x3ddbfc);_0x2d5400(_this[_0xbfd0('0x16')](0x1f4,_0x5dd79f[_0xbfd0('0x17')]));});});};
\ No newline at end of file
+var _0x7a11=['AddTagsToFaxInteraction','find','addTags','ids','omit','spread','debug','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./faxInteraction.socket','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','raw','options','where','limit'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x7a11,0x1c0));var _0x17a1=function(_0x295c6d,_0x11a9fb){_0x295c6d=_0x295c6d-0x0;var _0xa31b90=_0x7a11[_0x295c6d];return _0xa31b90;};'use strict';var _=require(_0x17a1('0x0'));var util=require(_0x17a1('0x1'));var moment=require(_0x17a1('0x2'));var BPromise=require(_0x17a1('0x3'));var rs=require(_0x17a1('0x4'));var fs=require('fs');var Redis=require(_0x17a1('0x5'));var db=require(_0x17a1('0x6'))['db'];var utils=require(_0x17a1('0x7'));var logger=require(_0x17a1('0x8'))(_0x17a1('0x9'));var config=require(_0x17a1('0xa'));var jayson=require(_0x17a1('0xb'));var client=jayson[_0x17a1('0xc')][_0x17a1('0xd')]({'port':0x232a});config['redis']=_[_0x17a1('0xe')](config[_0x17a1('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x17a1('0x10'))(new Redis(config[_0x17a1('0xf')]));require(_0x17a1('0x11'))['register'](socket);function respondWithRpcPromise(_0x45bea5,_0x2afe31,_0x4edab2){return new BPromise(function(_0x465c87,_0x374765){return client['request'](_0x45bea5,_0x4edab2)[_0x17a1('0x12')](function(_0x3f6418){logger['info'](_0x17a1('0x13'),_0x2afe31,_0x17a1('0x14'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x2afe31,_0x17a1('0x14'),JSON[_0x17a1('0x15')](_0x3f6418));if(_0x3f6418['error']){if(_0x3f6418[_0x17a1('0x16')][_0x17a1('0x17')]===0x1f4){logger[_0x17a1('0x16')](_0x17a1('0x13'),_0x2afe31,_0x3f6418[_0x17a1('0x16')][_0x17a1('0x18')]);return _0x374765(_0x3f6418[_0x17a1('0x16')]['message']);}logger[_0x17a1('0x16')](_0x17a1('0x13'),_0x2afe31,_0x3f6418['error'][_0x17a1('0x18')]);return _0x465c87(_0x3f6418['error'][_0x17a1('0x18')]);}else{logger[_0x17a1('0x19')](_0x17a1('0x13'),_0x2afe31,_0x17a1('0x14'));_0x465c87(_0x3f6418[_0x17a1('0x1a')][_0x17a1('0x18')]);}})[_0x17a1('0x1b')](function(_0x41f9aa){logger[_0x17a1('0x16')](_0x17a1('0x13'),_0x2afe31,_0x41f9aa);_0x374765(_0x41f9aa);});});}exports[_0x17a1('0x1c')]=function(_0x1a3bfa){var _0x250dda=this;return new Promise(function(_0x206127,_0x137a88){return db[_0x17a1('0x1d')][_0x17a1('0x1e')](_0x1a3bfa[_0x17a1('0x1f')],{'raw':_0x1a3bfa['options']?_0x1a3bfa['options'][_0x17a1('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a3bfa['options']?_0x1a3bfa[_0x17a1('0x21')][_0x17a1('0x22')]||null:null,'attributes':_0x1a3bfa[_0x17a1('0x21')]?_0x1a3bfa['options']['attributes']||null:null,'limit':_0x1a3bfa['options']?_0x1a3bfa[_0x17a1('0x21')][_0x17a1('0x23')]||null:null})['then'](function(_0x2ebc77){logger['info'](_0x17a1('0x1c'),_0x1a3bfa);logger['debug'](_0x17a1('0x1c'),_0x1a3bfa,JSON[_0x17a1('0x15')](_0x2ebc77));_0x206127(_0x2ebc77);})[_0x17a1('0x1b')](function(_0x311c6b){logger[_0x17a1('0x16')](_0x17a1('0x1c'),_0x311c6b[_0x17a1('0x18')],_0x1a3bfa);_0x137a88(_0x250dda[_0x17a1('0x16')](0x1f4,_0x311c6b[_0x17a1('0x18')]));});});};exports[_0x17a1('0x24')]=function(_0x4ca5f3){return new Promise(function(_0x4d52f0,_0x11b004){return db[_0x17a1('0x1d')][_0x17a1('0x25')]({'where':_0x4ca5f3[_0x17a1('0x21')]?_0x4ca5f3['options'][_0x17a1('0x22')]||null:null})[_0x17a1('0x12')](function(_0x2334fd){if(_0x2334fd){return _0x2334fd[_0x17a1('0x26')](_0x4ca5f3[_0x17a1('0x1f')][_0x17a1('0x27')],_[_0x17a1('0x28')](_0x4ca5f3['body'],[_0x17a1('0x27'),'id'])||{});}})[_0x17a1('0x29')](function(_0x5be687){logger[_0x17a1('0x19')]('AddTags',_0x4ca5f3);logger[_0x17a1('0x2a')](_0x17a1('0x2b'),_0x4ca5f3,JSON[_0x17a1('0x15')](_0x5be687));_0x4d52f0(_0x5be687);})[_0x17a1('0x1b')](function(_0x52b3ad){logger[_0x17a1('0x16')](_0x17a1('0x2b'),_0x52b3ad[_0x17a1('0x18')],_0x4ca5f3);_0x11b004(_this['error'](0x1f4,_0x52b3ad[_0x17a1('0x18')]));});});};
\ No newline at end of file