c99041769cee6217c09fde6bff46f63271332ae1
[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 _0x6f3a=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x40262b,_0x3c686f){var _0x14b367=function(_0x340d29){while(--_0x340d29){_0x40262b['push'](_0x40262b['shift']());}};_0x14b367(++_0x3c686f);}(_0x6f3a,0x8e));var _0xa6f3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f3a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa6f3('0x0'));var util=require(_0xa6f3('0x1'));var moment=require(_0xa6f3('0x2'));var BPromise=require(_0xa6f3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f3('0x4'));var db=require(_0xa6f3('0x5'))['db'];var utils=require(_0xa6f3('0x6'));var logger=require(_0xa6f3('0x7'))(_0xa6f3('0x8'));var config=require(_0xa6f3('0x9'));var jayson=require(_0xa6f3('0xa'));var client=jayson[_0xa6f3('0xb')][_0xa6f3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b082e,_0x1b1d16,_0x38c528){return new BPromise(function(_0x4a6207,_0x4d6caf){return client[_0xa6f3('0xd')](_0x5b082e,_0x38c528)[_0xa6f3('0xe')](function(_0x1ef54b){logger[_0xa6f3('0xf')](_0xa6f3('0x10'),_0x1b1d16,_0xa6f3('0x11'));logger[_0xa6f3('0x12')]('Condition,\x20%s,\x20%s,\x20%s',_0x1b1d16,_0xa6f3('0x11'),JSON[_0xa6f3('0x13')](_0x1ef54b));if(_0x1ef54b['error']){if(_0x1ef54b[_0xa6f3('0x14')][_0xa6f3('0x15')]===0x1f4){logger[_0xa6f3('0x14')](_0xa6f3('0x10'),_0x1b1d16,_0x1ef54b[_0xa6f3('0x14')][_0xa6f3('0x16')]);return _0x4d6caf(_0x1ef54b['error'][_0xa6f3('0x16')]);}logger['error'](_0xa6f3('0x10'),_0x1b1d16,_0x1ef54b['error'][_0xa6f3('0x16')]);return _0x4a6207(_0x1ef54b[_0xa6f3('0x14')][_0xa6f3('0x16')]);}else{logger[_0xa6f3('0xf')]('Condition,\x20%s,\x20%s',_0x1b1d16,_0xa6f3('0x11'));_0x4a6207(_0x1ef54b[_0xa6f3('0x17')][_0xa6f3('0x16')]);}})[_0xa6f3('0x18')](function(_0x1430ce){logger[_0xa6f3('0x14')]('Condition,\x20%s,\x20%s',_0x1b1d16,_0x1430ce);_0x4d6caf(_0x1430ce);});});}