Built motion from commit 85328c08.|2.5.50
[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 _0xf4a1=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf4a1,0xc2));var _0x1f4a=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xf4a1[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x1f4a('0x0'));var util=require(_0x1f4a('0x1'));var moment=require(_0x1f4a('0x2'));var BPromise=require(_0x1f4a('0x3'));var rs=require(_0x1f4a('0x4'));var fs=require('fs');var Redis=require(_0x1f4a('0x5'));var db=require(_0x1f4a('0x6'))['db'];var utils=require(_0x1f4a('0x7'));var logger=require(_0x1f4a('0x8'))(_0x1f4a('0x9'));var config=require(_0x1f4a('0xa'));var jayson=require(_0x1f4a('0xb'));var client=jayson[_0x1f4a('0xc')][_0x1f4a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x20c13e,_0x2bd2be,_0x19e53f){return new BPromise(function(_0x988642,_0x141955){return client[_0x1f4a('0xe')](_0x20c13e,_0x19e53f)[_0x1f4a('0xf')](function(_0x58300a){logger['info'](_0x1f4a('0x10'),_0x2bd2be,'request\x20sent');logger[_0x1f4a('0x11')](_0x1f4a('0x12'),_0x2bd2be,_0x1f4a('0x13'),JSON[_0x1f4a('0x14')](_0x58300a));if(_0x58300a[_0x1f4a('0x15')]){if(_0x58300a['error'][_0x1f4a('0x16')]===0x1f4){logger['error'](_0x1f4a('0x10'),_0x2bd2be,_0x58300a[_0x1f4a('0x15')][_0x1f4a('0x17')]);return _0x141955(_0x58300a[_0x1f4a('0x15')][_0x1f4a('0x17')]);}logger['error'](_0x1f4a('0x10'),_0x2bd2be,_0x58300a[_0x1f4a('0x15')][_0x1f4a('0x17')]);return _0x988642(_0x58300a[_0x1f4a('0x15')][_0x1f4a('0x17')]);}else{logger[_0x1f4a('0x18')](_0x1f4a('0x10'),_0x2bd2be,_0x1f4a('0x13'));_0x988642(_0x58300a[_0x1f4a('0x19')][_0x1f4a('0x17')]);}})[_0x1f4a('0x1a')](function(_0xce8acf){logger[_0x1f4a('0x15')]('Condition,\x20%s,\x20%s',_0x2bd2be,_0xce8acf);_0x141955(_0xce8acf);});});}