Built motion from commit (unavailable).|2.5.0
[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 _0xc5c6=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','error','code','message','Condition,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x3fd0f3,_0x5763c6){var _0x4df1e9=function(_0x50b4ad){while(--_0x50b4ad){_0x3fd0f3['push'](_0x3fd0f3['shift']());}};_0x4df1e9(++_0x5763c6);}(_0xc5c6,0x161));var _0x6c5c=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xc5c6[_0x1a7846];return _0x48049;};'use strict';var _=require(_0x6c5c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6c5c('0x1'));var rs=require(_0x6c5c('0x2'));var fs=require('fs');var Redis=require(_0x6c5c('0x3'));var db=require(_0x6c5c('0x4'))['db'];var utils=require(_0x6c5c('0x5'));var logger=require(_0x6c5c('0x6'))(_0x6c5c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6c5c('0x8')][_0x6c5c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f4123,_0x5d742e,_0x1b4cc6){return new BPromise(function(_0x10dc2d,_0x50b6ef){return client[_0x6c5c('0xa')](_0x3f4123,_0x1b4cc6)[_0x6c5c('0xb')](function(_0x4a4b5e){logger[_0x6c5c('0xc')]('Condition,\x20%s,\x20%s',_0x5d742e,_0x6c5c('0xd'));logger[_0x6c5c('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x5d742e,_0x6c5c('0xd'),JSON['stringify'](_0x4a4b5e));if(_0x4a4b5e[_0x6c5c('0xf')]){if(_0x4a4b5e[_0x6c5c('0xf')][_0x6c5c('0x10')]===0x1f4){logger[_0x6c5c('0xf')]('Condition,\x20%s,\x20%s',_0x5d742e,_0x4a4b5e['error'][_0x6c5c('0x11')]);return _0x50b6ef(_0x4a4b5e[_0x6c5c('0xf')][_0x6c5c('0x11')]);}logger[_0x6c5c('0xf')](_0x6c5c('0x12'),_0x5d742e,_0x4a4b5e[_0x6c5c('0xf')][_0x6c5c('0x11')]);return _0x10dc2d(_0x4a4b5e['error']['message']);}else{logger[_0x6c5c('0xc')](_0x6c5c('0x12'),_0x5d742e,_0x6c5c('0xd'));_0x10dc2d(_0x4a4b5e[_0x6c5c('0x13')][_0x6c5c('0x11')]);}})[_0x6c5c('0x14')](function(_0x1fd013){logger['error'](_0x6c5c('0x12'),_0x5d742e,_0x1fd013);_0x50b6ef(_0x1fd013);});});}