Built motion from commit (unavailable).|2.5.6
[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 _0xf0bf=['../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4f296b,_0x4d43c0){var _0xbed6a8=function(_0x336efa){while(--_0x336efa){_0x4f296b['push'](_0x4f296b['shift']());}};_0xbed6a8(++_0x4d43c0);}(_0xf0bf,0x162));var _0xff0b=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xf0bf[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xff0b('0x0'));var util=require(_0xff0b('0x1'));var moment=require(_0xff0b('0x2'));var BPromise=require(_0xff0b('0x3'));var rs=require(_0xff0b('0x4'));var fs=require('fs');var Redis=require(_0xff0b('0x5'));var db=require(_0xff0b('0x6'))['db'];var utils=require(_0xff0b('0x7'));var logger=require(_0xff0b('0x8'))(_0xff0b('0x9'));var config=require(_0xff0b('0xa'));var jayson=require(_0xff0b('0xb'));var client=jayson[_0xff0b('0xc')][_0xff0b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4e5849,_0x568cce,_0x3ceecf){return new BPromise(function(_0x1cbdc7,_0xe313ca){return client[_0xff0b('0xe')](_0x4e5849,_0x3ceecf)[_0xff0b('0xf')](function(_0x3e3723){logger[_0xff0b('0x10')](_0xff0b('0x11'),_0x568cce,'request\x20sent');logger[_0xff0b('0x12')](_0xff0b('0x13'),_0x568cce,_0xff0b('0x14'),JSON[_0xff0b('0x15')](_0x3e3723));if(_0x3e3723['error']){if(_0x3e3723[_0xff0b('0x16')][_0xff0b('0x17')]===0x1f4){logger[_0xff0b('0x16')](_0xff0b('0x11'),_0x568cce,_0x3e3723[_0xff0b('0x16')]['message']);return _0xe313ca(_0x3e3723[_0xff0b('0x16')]['message']);}logger[_0xff0b('0x16')](_0xff0b('0x11'),_0x568cce,_0x3e3723[_0xff0b('0x16')][_0xff0b('0x18')]);return _0x1cbdc7(_0x3e3723[_0xff0b('0x16')][_0xff0b('0x18')]);}else{logger[_0xff0b('0x10')](_0xff0b('0x11'),_0x568cce,_0xff0b('0x14'));_0x1cbdc7(_0x3e3723['result'][_0xff0b('0x18')]);}})[_0xff0b('0x19')](function(_0x2d3ece){logger[_0xff0b('0x16')]('Condition,\x20%s,\x20%s',_0x568cce,_0x2d3ece);_0xe313ca(_0x2d3ece);});});}