Built motion from commit 14588770.|2.5.38
[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 _0xf30f=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x319e2e,_0x2f727f){var _0x302524=function(_0x5cad9d){while(--_0x5cad9d){_0x319e2e['push'](_0x319e2e['shift']());}};_0x302524(++_0x2f727f);}(_0xf30f,0x16d));var _0xff30=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xf30f[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xff30('0x0'));var util=require(_0xff30('0x1'));var moment=require(_0xff30('0x2'));var BPromise=require(_0xff30('0x3'));var rs=require(_0xff30('0x4'));var fs=require('fs');var Redis=require(_0xff30('0x5'));var db=require(_0xff30('0x6'))['db'];var utils=require(_0xff30('0x7'));var logger=require(_0xff30('0x8'))(_0xff30('0x9'));var config=require(_0xff30('0xa'));var jayson=require(_0xff30('0xb'));var client=jayson[_0xff30('0xc')][_0xff30('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x540047,_0x14ec72,_0x2f9b4f){return new BPromise(function(_0x49aff9,_0x1f801b){return client['request'](_0x540047,_0x2f9b4f)[_0xff30('0xe')](function(_0xce1b52){logger[_0xff30('0xf')]('Condition,\x20%s,\x20%s',_0x14ec72,_0xff30('0x10'));logger['debug'](_0xff30('0x11'),_0x14ec72,_0xff30('0x10'),JSON[_0xff30('0x12')](_0xce1b52));if(_0xce1b52[_0xff30('0x13')]){if(_0xce1b52[_0xff30('0x13')][_0xff30('0x14')]===0x1f4){logger[_0xff30('0x13')](_0xff30('0x15'),_0x14ec72,_0xce1b52[_0xff30('0x13')][_0xff30('0x16')]);return _0x1f801b(_0xce1b52['error'][_0xff30('0x16')]);}logger['error'](_0xff30('0x15'),_0x14ec72,_0xce1b52[_0xff30('0x13')][_0xff30('0x16')]);return _0x49aff9(_0xce1b52['error'][_0xff30('0x16')]);}else{logger['info'](_0xff30('0x15'),_0x14ec72,_0xff30('0x10'));_0x49aff9(_0xce1b52[_0xff30('0x17')][_0xff30('0x16')]);}})[_0xff30('0x18')](function(_0x15d205){logger[_0xff30('0x13')]('Condition,\x20%s,\x20%s',_0x14ec72,_0x15d205);_0x1f801b(_0x15d205);});});}