Built motion from commit (unavailable).|2.5.17
[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 _0xa8fb=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0xa8fb,0x198));var _0xba8f=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xa8fb[_0x344a3f];return _0x264712;};'use strict';var _=require(_0xba8f('0x0'));var util=require(_0xba8f('0x1'));var moment=require('moment');var BPromise=require(_0xba8f('0x2'));var rs=require(_0xba8f('0x3'));var fs=require('fs');var Redis=require(_0xba8f('0x4'));var db=require(_0xba8f('0x5'))['db'];var utils=require(_0xba8f('0x6'));var logger=require(_0xba8f('0x7'))(_0xba8f('0x8'));var config=require(_0xba8f('0x9'));var jayson=require(_0xba8f('0xa'));var client=jayson[_0xba8f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x565b7d,_0x5aa0fd,_0x1b70d5){return new BPromise(function(_0x7db4d9,_0x26411f){return client[_0xba8f('0xc')](_0x565b7d,_0x1b70d5)['then'](function(_0x326f27){logger[_0xba8f('0xd')](_0xba8f('0xe'),_0x5aa0fd,_0xba8f('0xf'));logger[_0xba8f('0x10')](_0xba8f('0x11'),_0x5aa0fd,'request\x20sent',JSON[_0xba8f('0x12')](_0x326f27));if(_0x326f27[_0xba8f('0x13')]){if(_0x326f27[_0xba8f('0x13')][_0xba8f('0x14')]===0x1f4){logger[_0xba8f('0x13')]('Condition,\x20%s,\x20%s',_0x5aa0fd,_0x326f27[_0xba8f('0x13')][_0xba8f('0x15')]);return _0x26411f(_0x326f27['error'][_0xba8f('0x15')]);}logger['error'](_0xba8f('0xe'),_0x5aa0fd,_0x326f27[_0xba8f('0x13')]['message']);return _0x7db4d9(_0x326f27[_0xba8f('0x13')][_0xba8f('0x15')]);}else{logger[_0xba8f('0xd')]('Condition,\x20%s,\x20%s',_0x5aa0fd,'request\x20sent');_0x7db4d9(_0x326f27[_0xba8f('0x16')][_0xba8f('0x15')]);}})[_0xba8f('0x17')](function(_0x32eb92){logger[_0xba8f('0x13')]('Condition,\x20%s,\x20%s',_0x5aa0fd,_0x32eb92);_0x26411f(_0x32eb92);});});}