Built motion from commit (unavailable).|2.5.29
[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 _0x4dd2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x4dd2,0xdd));var _0x24dd=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0x4dd2[_0x119b3e];return _0x1169ae;};'use strict';var _=require(_0x24dd('0x0'));var util=require(_0x24dd('0x1'));var moment=require(_0x24dd('0x2'));var BPromise=require(_0x24dd('0x3'));var rs=require(_0x24dd('0x4'));var fs=require('fs');var Redis=require(_0x24dd('0x5'));var db=require(_0x24dd('0x6'))['db'];var utils=require(_0x24dd('0x7'));var logger=require(_0x24dd('0x8'))(_0x24dd('0x9'));var config=require(_0x24dd('0xa'));var jayson=require(_0x24dd('0xb'));var client=jayson[_0x24dd('0xc')][_0x24dd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x158116,_0x37bb84,_0x468b3a){return new BPromise(function(_0x32adcd,_0x240874){return client[_0x24dd('0xe')](_0x158116,_0x468b3a)[_0x24dd('0xf')](function(_0x46fed6){logger[_0x24dd('0x10')](_0x24dd('0x11'),_0x37bb84,_0x24dd('0x12'));logger[_0x24dd('0x13')](_0x24dd('0x14'),_0x37bb84,'request\x20sent',JSON[_0x24dd('0x15')](_0x46fed6));if(_0x46fed6[_0x24dd('0x16')]){if(_0x46fed6[_0x24dd('0x16')]['code']===0x1f4){logger[_0x24dd('0x16')](_0x24dd('0x11'),_0x37bb84,_0x46fed6[_0x24dd('0x16')]['message']);return _0x240874(_0x46fed6[_0x24dd('0x16')][_0x24dd('0x17')]);}logger[_0x24dd('0x16')](_0x24dd('0x11'),_0x37bb84,_0x46fed6['error']['message']);return _0x32adcd(_0x46fed6[_0x24dd('0x16')]['message']);}else{logger['info']('Condition,\x20%s,\x20%s',_0x37bb84,_0x24dd('0x12'));_0x32adcd(_0x46fed6[_0x24dd('0x18')][_0x24dd('0x17')]);}})['catch'](function(_0x1424a1){logger[_0x24dd('0x16')](_0x24dd('0x11'),_0x37bb84,_0x1424a1);_0x240874(_0x1424a1);});});}