02949fdcc2f107b8ccc3826ebad76c45649aff88
[motion2.git] / server / api / condition / condition.rpc.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xf278=['Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Condition,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x394c4c,_0x201031){var _0x5bfa5a=function(_0x4a5eed){while(--_0x4a5eed){_0x394c4c['push'](_0x394c4c['shift']());}};_0x5bfa5a(++_0x201031);}(_0xf278,0x16e));var _0x8f27=function(_0x65c597,_0x39e7e0){_0x65c597=_0x65c597-0x0;var _0x1ec368=_0xf278[_0x65c597];return _0x1ec368;};'use strict';var _=require(_0x8f27('0x0'));var util=require(_0x8f27('0x1'));var moment=require(_0x8f27('0x2'));var BPromise=require(_0x8f27('0x3'));var rs=require(_0x8f27('0x4'));var fs=require('fs');var Redis=require(_0x8f27('0x5'));var db=require(_0x8f27('0x6'))['db'];var utils=require(_0x8f27('0x7'));var logger=require(_0x8f27('0x8'))(_0x8f27('0x9'));var config=require(_0x8f27('0xa'));var jayson=require(_0x8f27('0xb'));var client=jayson[_0x8f27('0xc')][_0x8f27('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26877f,_0x374f80,_0x2d2315){return new BPromise(function(_0x59c7e9,_0x14eb5c){return client['request'](_0x26877f,_0x2d2315)['then'](function(_0x45c8ec){logger[_0x8f27('0xe')](_0x8f27('0xf'),_0x374f80,_0x8f27('0x10'));logger[_0x8f27('0x11')](_0x8f27('0x12'),_0x374f80,'request\x20sent',JSON['stringify'](_0x45c8ec));if(_0x45c8ec[_0x8f27('0x13')]){if(_0x45c8ec[_0x8f27('0x13')][_0x8f27('0x14')]===0x1f4){logger[_0x8f27('0x13')](_0x8f27('0xf'),_0x374f80,_0x45c8ec['error'][_0x8f27('0x15')]);return _0x14eb5c(_0x45c8ec[_0x8f27('0x13')][_0x8f27('0x15')]);}logger[_0x8f27('0x13')](_0x8f27('0xf'),_0x374f80,_0x45c8ec[_0x8f27('0x13')][_0x8f27('0x15')]);return _0x59c7e9(_0x45c8ec['error'][_0x8f27('0x15')]);}else{logger[_0x8f27('0xe')](_0x8f27('0xf'),_0x374f80,'request\x20sent');_0x59c7e9(_0x45c8ec[_0x8f27('0x16')][_0x8f27('0x15')]);}})[_0x8f27('0x17')](function(_0x34310d){logger['error'](_0x8f27('0xf'),_0x374f80,_0x34310d);_0x14eb5c(_0x34310d);});});}