Built motion from commit (unavailable).|2.4.18
[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 _0x54cd=['error','code','message','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','client','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0x54cd,0x1d9));var _0xd54c=function(_0x120139,_0x51160e){_0x120139=_0x120139-0x0;var _0x183f8c=_0x54cd[_0x120139];return _0x183f8c;};'use strict';var _=require(_0xd54c('0x0'));var util=require(_0xd54c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd54c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd54c('0x3'));var logger=require(_0xd54c('0x4'))(_0xd54c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd54c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe1b4b9,_0x1e30da,_0x523c94){return new BPromise(function(_0x839372,_0x49bee7){return client['request'](_0xe1b4b9,_0x523c94)[_0xd54c('0x7')](function(_0x1eb11e){logger[_0xd54c('0x8')](_0xd54c('0x9'),_0x1e30da,_0xd54c('0xa'));logger['debug'](_0xd54c('0xb'),_0x1e30da,_0xd54c('0xa'),JSON[_0xd54c('0xc')](_0x1eb11e));if(_0x1eb11e[_0xd54c('0xd')]){if(_0x1eb11e[_0xd54c('0xd')][_0xd54c('0xe')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x1e30da,_0x1eb11e[_0xd54c('0xd')]['message']);return _0x49bee7(_0x1eb11e[_0xd54c('0xd')][_0xd54c('0xf')]);}logger[_0xd54c('0xd')]('Condition,\x20%s,\x20%s',_0x1e30da,_0x1eb11e[_0xd54c('0xd')]['message']);return _0x839372(_0x1eb11e[_0xd54c('0xd')][_0xd54c('0xf')]);}else{logger[_0xd54c('0x8')](_0xd54c('0x9'),_0x1e30da,_0xd54c('0xa'));_0x839372(_0x1eb11e[_0xd54c('0x10')][_0xd54c('0xf')]);}})[_0xd54c('0x11')](function(_0x1b9f4d){logger[_0xd54c('0xd')]('Condition,\x20%s,\x20%s',_0x1e30da,_0x1b9f4d);_0x49bee7(_0x1b9f4d);});});}