Built motion from commit e02f907f.|2.6.14
[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 _0xae8e=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x28784a,_0x38d42e){var _0xbc557f=function(_0x9b03da){while(--_0x9b03da){_0x28784a['push'](_0x28784a['shift']());}};_0xbc557f(++_0x38d42e);}(_0xae8e,0x12c));var _0xeae8=function(_0x363f4c,_0x56dfb2){_0x363f4c=_0x363f4c-0x0;var _0x44175b=_0xae8e[_0x363f4c];return _0x44175b;};'use strict';var _=require(_0xeae8('0x0'));var util=require(_0xeae8('0x1'));var moment=require(_0xeae8('0x2'));var BPromise=require(_0xeae8('0x3'));var rs=require(_0xeae8('0x4'));var fs=require('fs');var Redis=require(_0xeae8('0x5'));var db=require(_0xeae8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xeae8('0x7'))(_0xeae8('0x8'));var config=require(_0xeae8('0x9'));var jayson=require(_0xeae8('0xa'));var client=jayson['client'][_0xeae8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x490896,_0x5cccde,_0x38daff){return new BPromise(function(_0x4e3e7f,_0xb736e0){return client['request'](_0x490896,_0x38daff)[_0xeae8('0xc')](function(_0x35ab6e){logger[_0xeae8('0xd')](_0xeae8('0xe'),_0x5cccde,_0xeae8('0xf'));logger[_0xeae8('0x10')](_0xeae8('0x11'),_0x5cccde,'request\x20sent',JSON[_0xeae8('0x12')](_0x35ab6e));if(_0x35ab6e[_0xeae8('0x13')]){if(_0x35ab6e[_0xeae8('0x13')][_0xeae8('0x14')]===0x1f4){logger[_0xeae8('0x13')](_0xeae8('0xe'),_0x5cccde,_0x35ab6e[_0xeae8('0x13')]['message']);return _0xb736e0(_0x35ab6e[_0xeae8('0x13')]['message']);}logger[_0xeae8('0x13')](_0xeae8('0xe'),_0x5cccde,_0x35ab6e[_0xeae8('0x13')][_0xeae8('0x15')]);return _0x4e3e7f(_0x35ab6e['error']['message']);}else{logger[_0xeae8('0xd')]('Condition,\x20%s,\x20%s',_0x5cccde,_0xeae8('0xf'));_0x4e3e7f(_0x35ab6e[_0xeae8('0x16')][_0xeae8('0x15')]);}})['catch'](function(_0x5443e5){logger['error'](_0xeae8('0xe'),_0x5cccde,_0x5443e5);_0xb736e0(_0x5443e5);});});}