Built motion from commit 3e059bc2.|2.5.32
[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 _0xc293=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2a829d,_0x51d5c0){var _0xdee456=function(_0x14c5f7){while(--_0x14c5f7){_0x2a829d['push'](_0x2a829d['shift']());}};_0xdee456(++_0x51d5c0);}(_0xc293,0x12c));var _0x3c29=function(_0x47b9d3,_0x18f3a1){_0x47b9d3=_0x47b9d3-0x0;var _0xfa7c91=_0xc293[_0x47b9d3];return _0xfa7c91;};'use strict';var _=require(_0x3c29('0x0'));var util=require(_0x3c29('0x1'));var moment=require(_0x3c29('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c29('0x3'));var fs=require('fs');var Redis=require(_0x3c29('0x4'));var db=require(_0x3c29('0x5'))['db'];var utils=require(_0x3c29('0x6'));var logger=require(_0x3c29('0x7'))(_0x3c29('0x8'));var config=require(_0x3c29('0x9'));var jayson=require(_0x3c29('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c1e7b,_0x311a54,_0x31df80){return new BPromise(function(_0x4b6947,_0x5c078a){return client[_0x3c29('0xb')](_0x1c1e7b,_0x31df80)[_0x3c29('0xc')](function(_0x2c6506){logger[_0x3c29('0xd')](_0x3c29('0xe'),_0x311a54,_0x3c29('0xf'));logger[_0x3c29('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x311a54,_0x3c29('0xf'),JSON[_0x3c29('0x11')](_0x2c6506));if(_0x2c6506['error']){if(_0x2c6506[_0x3c29('0x12')][_0x3c29('0x13')]===0x1f4){logger[_0x3c29('0x12')](_0x3c29('0xe'),_0x311a54,_0x2c6506['error'][_0x3c29('0x14')]);return _0x5c078a(_0x2c6506[_0x3c29('0x12')][_0x3c29('0x14')]);}logger[_0x3c29('0x12')](_0x3c29('0xe'),_0x311a54,_0x2c6506[_0x3c29('0x12')]['message']);return _0x4b6947(_0x2c6506[_0x3c29('0x12')][_0x3c29('0x14')]);}else{logger['info'](_0x3c29('0xe'),_0x311a54,_0x3c29('0xf'));_0x4b6947(_0x2c6506[_0x3c29('0x15')][_0x3c29('0x14')]);}})[_0x3c29('0x16')](function(_0x1c8575){logger[_0x3c29('0x12')]('Condition,\x20%s,\x20%s',_0x311a54,_0x1c8575);_0x5c078a(_0x1c8575);});});}