3ef4f6b1e72fdeb7bbb94f261edb0b13877de3f0
[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 _0xfc7c=['http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4460c1,_0x29c421){var _0x470a20=function(_0x5b0dd4){while(--_0x5b0dd4){_0x4460c1['push'](_0x4460c1['shift']());}};_0x470a20(++_0x29c421);}(_0xfc7c,0x1ed));var _0xcfc7=function(_0x295e71,_0x548592){_0x295e71=_0x295e71-0x0;var _0x5a717d=_0xfc7c[_0x295e71];return _0x5a717d;};'use strict';var _=require(_0xcfc7('0x0'));var util=require('util');var moment=require(_0xcfc7('0x1'));var BPromise=require(_0xcfc7('0x2'));var rs=require(_0xcfc7('0x3'));var fs=require('fs');var Redis=require(_0xcfc7('0x4'));var db=require(_0xcfc7('0x5'))['db'];var utils=require(_0xcfc7('0x6'));var logger=require('../../config/logger')(_0xcfc7('0x7'));var config=require(_0xcfc7('0x8'));var jayson=require(_0xcfc7('0x9'));var client=jayson[_0xcfc7('0xa')][_0xcfc7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32892c,_0x5d0f26,_0x362986){return new BPromise(function(_0x5d39c8,_0x55d234){return client[_0xcfc7('0xc')](_0x32892c,_0x362986)[_0xcfc7('0xd')](function(_0x37036b){logger['info'](_0xcfc7('0xe'),_0x5d0f26,_0xcfc7('0xf'));logger[_0xcfc7('0x10')](_0xcfc7('0x11'),_0x5d0f26,'request\x20sent',JSON[_0xcfc7('0x12')](_0x37036b));if(_0x37036b[_0xcfc7('0x13')]){if(_0x37036b[_0xcfc7('0x13')][_0xcfc7('0x14')]===0x1f4){logger[_0xcfc7('0x13')](_0xcfc7('0xe'),_0x5d0f26,_0x37036b['error'][_0xcfc7('0x15')]);return _0x55d234(_0x37036b[_0xcfc7('0x13')][_0xcfc7('0x15')]);}logger[_0xcfc7('0x13')](_0xcfc7('0xe'),_0x5d0f26,_0x37036b['error'][_0xcfc7('0x15')]);return _0x5d39c8(_0x37036b[_0xcfc7('0x13')][_0xcfc7('0x15')]);}else{logger['info'](_0xcfc7('0xe'),_0x5d0f26,'request\x20sent');_0x5d39c8(_0x37036b[_0xcfc7('0x16')][_0xcfc7('0x15')]);}})[_0xcfc7('0x17')](function(_0x2b8251){logger[_0xcfc7('0x13')](_0xcfc7('0xe'),_0x5d0f26,_0x2b8251);_0x55d234(_0x2b8251);});});}