Built motion from commit (unavailable).|2.5.23
[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 _0xf85c=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','Condition,\x20%s,\x20%s','message','result'];(function(_0x3e1b3f,_0x19bdc7){var _0x33b963=function(_0x2543ce){while(--_0x2543ce){_0x3e1b3f['push'](_0x3e1b3f['shift']());}};_0x33b963(++_0x19bdc7);}(_0xf85c,0x8b));var _0xcf85=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xf85c[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var util=require(_0xcf85('0x0'));var moment=require(_0xcf85('0x1'));var BPromise=require(_0xcf85('0x2'));var rs=require(_0xcf85('0x3'));var fs=require('fs');var Redis=require(_0xcf85('0x4'));var db=require(_0xcf85('0x5'))['db'];var utils=require(_0xcf85('0x6'));var logger=require(_0xcf85('0x7'))(_0xcf85('0x8'));var config=require(_0xcf85('0x9'));var jayson=require(_0xcf85('0xa'));var client=jayson[_0xcf85('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5add41,_0x40ff2d,_0xbdf02e){return new BPromise(function(_0x31dedb,_0x177299){return client[_0xcf85('0xc')](_0x5add41,_0xbdf02e)[_0xcf85('0xd')](function(_0xe2d18a){logger[_0xcf85('0xe')]('Condition,\x20%s,\x20%s',_0x40ff2d,_0xcf85('0xf'));logger['debug'](_0xcf85('0x10'),_0x40ff2d,_0xcf85('0xf'),JSON[_0xcf85('0x11')](_0xe2d18a));if(_0xe2d18a[_0xcf85('0x12')]){if(_0xe2d18a[_0xcf85('0x12')]['code']===0x1f4){logger['error'](_0xcf85('0x13'),_0x40ff2d,_0xe2d18a[_0xcf85('0x12')]['message']);return _0x177299(_0xe2d18a[_0xcf85('0x12')]['message']);}logger['error']('Condition,\x20%s,\x20%s',_0x40ff2d,_0xe2d18a['error']['message']);return _0x31dedb(_0xe2d18a[_0xcf85('0x12')][_0xcf85('0x14')]);}else{logger['info'](_0xcf85('0x13'),_0x40ff2d,_0xcf85('0xf'));_0x31dedb(_0xe2d18a[_0xcf85('0x15')][_0xcf85('0x14')]);}})[_0xcf85('0x16')](function(_0x235684){logger[_0xcf85('0x12')](_0xcf85('0x13'),_0x40ff2d,_0x235684);_0x177299(_0x235684);});});}