Built motion from commit 56a37f2a.|2.6.21
[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 _0x4ebb=['moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x4ebb,0xc4));var _0xb4eb=function(_0x391ce2,_0xa796e){_0x391ce2=_0x391ce2-0x0;var _0xb8371d=_0x4ebb[_0x391ce2];return _0xb8371d;};'use strict';var _=require(_0xb4eb('0x0'));var util=require(_0xb4eb('0x1'));var moment=require(_0xb4eb('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4eb('0x3'));var fs=require('fs');var Redis=require(_0xb4eb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb4eb('0x5'));var config=require(_0xb4eb('0x6'));var jayson=require(_0xb4eb('0x7'));var client=jayson['client'][_0xb4eb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51aebb,_0x22b327,_0x484447){return new BPromise(function(_0x4af4f6,_0x577027){return client[_0xb4eb('0x9')](_0x51aebb,_0x484447)[_0xb4eb('0xa')](function(_0x762836){logger[_0xb4eb('0xb')](_0xb4eb('0xc'),_0x22b327,'request\x20sent');logger[_0xb4eb('0xd')](_0xb4eb('0xe'),_0x22b327,_0xb4eb('0xf'),JSON[_0xb4eb('0x10')](_0x762836));if(_0x762836[_0xb4eb('0x11')]){if(_0x762836[_0xb4eb('0x11')][_0xb4eb('0x12')]===0x1f4){logger['error'](_0xb4eb('0xc'),_0x22b327,_0x762836[_0xb4eb('0x11')]['message']);return _0x577027(_0x762836['error'][_0xb4eb('0x13')]);}logger[_0xb4eb('0x11')](_0xb4eb('0xc'),_0x22b327,_0x762836[_0xb4eb('0x11')][_0xb4eb('0x13')]);return _0x4af4f6(_0x762836[_0xb4eb('0x11')][_0xb4eb('0x13')]);}else{logger['info'](_0xb4eb('0xc'),_0x22b327,_0xb4eb('0xf'));_0x4af4f6(_0x762836[_0xb4eb('0x14')][_0xb4eb('0x13')]);}})[_0xb4eb('0x15')](function(_0x5c0402){logger[_0xb4eb('0x11')](_0xb4eb('0xc'),_0x22b327,_0x5c0402);_0x577027(_0x5c0402);});});}