590853adbaa420d8744c842c9a81ca5afd39db95
[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 _0xfc9c=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x445179,_0x389247){var _0x36626f=function(_0x54ca4e){while(--_0x54ca4e){_0x445179['push'](_0x445179['shift']());}};_0x36626f(++_0x389247);}(_0xfc9c,0x15f));var _0xcfc9=function(_0x4cea7d,_0x50f55b){_0x4cea7d=_0x4cea7d-0x0;var _0x36e72a=_0xfc9c[_0x4cea7d];return _0x36e72a;};'use strict';var _=require(_0xcfc9('0x0'));var util=require(_0xcfc9('0x1'));var moment=require(_0xcfc9('0x2'));var BPromise=require('bluebird');var rs=require(_0xcfc9('0x3'));var fs=require('fs');var Redis=require(_0xcfc9('0x4'));var db=require(_0xcfc9('0x5'))['db'];var utils=require(_0xcfc9('0x6'));var logger=require(_0xcfc9('0x7'))(_0xcfc9('0x8'));var config=require(_0xcfc9('0x9'));var jayson=require(_0xcfc9('0xa'));var client=jayson[_0xcfc9('0xb')][_0xcfc9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f6a0a,_0x4ce56a,_0x1173a1){return new BPromise(function(_0x23384a,_0x143b99){return client[_0xcfc9('0xd')](_0x1f6a0a,_0x1173a1)['then'](function(_0x5e1ff3){logger['info'](_0xcfc9('0xe'),_0x4ce56a,_0xcfc9('0xf'));logger[_0xcfc9('0x10')](_0xcfc9('0x11'),_0x4ce56a,_0xcfc9('0xf'),JSON[_0xcfc9('0x12')](_0x5e1ff3));if(_0x5e1ff3[_0xcfc9('0x13')]){if(_0x5e1ff3[_0xcfc9('0x13')][_0xcfc9('0x14')]===0x1f4){logger[_0xcfc9('0x13')](_0xcfc9('0xe'),_0x4ce56a,_0x5e1ff3['error']['message']);return _0x143b99(_0x5e1ff3[_0xcfc9('0x13')][_0xcfc9('0x15')]);}logger[_0xcfc9('0x13')](_0xcfc9('0xe'),_0x4ce56a,_0x5e1ff3[_0xcfc9('0x13')]['message']);return _0x23384a(_0x5e1ff3[_0xcfc9('0x13')][_0xcfc9('0x15')]);}else{logger[_0xcfc9('0x16')](_0xcfc9('0xe'),_0x4ce56a,_0xcfc9('0xf'));_0x23384a(_0x5e1ff3[_0xcfc9('0x17')][_0xcfc9('0x15')]);}})[_0xcfc9('0x18')](function(_0x2e3690){logger[_0xcfc9('0x13')](_0xcfc9('0xe'),_0x4ce56a,_0x2e3690);_0x143b99(_0x2e3690);});});}