Built motion from commit (unavailable).|2.5.16
[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 _0xc0e3=['Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x109665,_0x536f5c){var _0x48ef1f=function(_0x526a34){while(--_0x526a34){_0x109665['push'](_0x109665['shift']());}};_0x48ef1f(++_0x536f5c);}(_0xc0e3,0x1d4));var _0x3c0e=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xc0e3[_0x3fba9f];return _0x192cf1;};'use strict';var _=require('lodash');var util=require(_0x3c0e('0x0'));var moment=require(_0x3c0e('0x1'));var BPromise=require(_0x3c0e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c0e('0x3'));var db=require(_0x3c0e('0x4'))['db'];var utils=require(_0x3c0e('0x5'));var logger=require(_0x3c0e('0x6'))(_0x3c0e('0x7'));var config=require(_0x3c0e('0x8'));var jayson=require(_0x3c0e('0x9'));var client=jayson[_0x3c0e('0xa')][_0x3c0e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bd22d,_0x5105cb,_0x33d516){return new BPromise(function(_0x270c9a,_0x411bd4){return client[_0x3c0e('0xc')](_0x5bd22d,_0x33d516)[_0x3c0e('0xd')](function(_0x260d43){logger[_0x3c0e('0xe')](_0x3c0e('0xf'),_0x5105cb,'request\x20sent');logger[_0x3c0e('0x10')](_0x3c0e('0x11'),_0x5105cb,'request\x20sent',JSON['stringify'](_0x260d43));if(_0x260d43[_0x3c0e('0x12')]){if(_0x260d43[_0x3c0e('0x12')][_0x3c0e('0x13')]===0x1f4){logger[_0x3c0e('0x12')](_0x3c0e('0xf'),_0x5105cb,_0x260d43[_0x3c0e('0x12')]['message']);return _0x411bd4(_0x260d43[_0x3c0e('0x12')][_0x3c0e('0x14')]);}logger[_0x3c0e('0x12')](_0x3c0e('0xf'),_0x5105cb,_0x260d43['error'][_0x3c0e('0x14')]);return _0x270c9a(_0x260d43[_0x3c0e('0x12')]['message']);}else{logger[_0x3c0e('0xe')](_0x3c0e('0xf'),_0x5105cb,'request\x20sent');_0x270c9a(_0x260d43[_0x3c0e('0x15')][_0x3c0e('0x14')]);}})[_0x3c0e('0x16')](function(_0x4c4a3b){logger['error'](_0x3c0e('0xf'),_0x5105cb,_0x4c4a3b);_0x411bd4(_0x4c4a3b);});});}