Built motion from commit (unavailable).|2.5.9
[motion2.git] / server / api / chatApplication / chatApplication.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 _0xe9a5=['../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4ce735,_0x3bdb1e){var _0x45fd48=function(_0x434e04){while(--_0x434e04){_0x4ce735['push'](_0x4ce735['shift']());}};_0x45fd48(++_0x3bdb1e);}(_0xe9a5,0x6b));var _0x5e9a=function(_0x47044,_0x27b16f){_0x47044=_0x47044-0x0;var _0x205038=_0xe9a5[_0x47044];return _0x205038;};'use strict';var _=require(_0x5e9a('0x0'));var util=require('util');var moment=require(_0x5e9a('0x1'));var BPromise=require(_0x5e9a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e9a('0x3'));var db=require(_0x5e9a('0x4'))['db'];var utils=require(_0x5e9a('0x5'));var logger=require(_0x5e9a('0x6'))(_0x5e9a('0x7'));var config=require(_0x5e9a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5e9a('0x9')][_0x5e9a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x341df0,_0x4134be,_0x584180){return new BPromise(function(_0x4b7a4b,_0x5e63a6){return client[_0x5e9a('0xb')](_0x341df0,_0x584180)[_0x5e9a('0xc')](function(_0x3b22cf){logger[_0x5e9a('0xd')](_0x5e9a('0xe'),_0x4134be,'request\x20sent');logger[_0x5e9a('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4134be,'request\x20sent',JSON[_0x5e9a('0x10')](_0x3b22cf));if(_0x3b22cf['error']){if(_0x3b22cf[_0x5e9a('0x11')][_0x5e9a('0x12')]===0x1f4){logger[_0x5e9a('0x11')](_0x5e9a('0xe'),_0x4134be,_0x3b22cf[_0x5e9a('0x11')][_0x5e9a('0x13')]);return _0x5e63a6(_0x3b22cf[_0x5e9a('0x11')][_0x5e9a('0x13')]);}logger[_0x5e9a('0x11')](_0x5e9a('0xe'),_0x4134be,_0x3b22cf[_0x5e9a('0x11')][_0x5e9a('0x13')]);return _0x4b7a4b(_0x3b22cf[_0x5e9a('0x11')][_0x5e9a('0x13')]);}else{logger[_0x5e9a('0xd')](_0x5e9a('0xe'),_0x4134be,_0x5e9a('0x14'));_0x4b7a4b(_0x3b22cf[_0x5e9a('0x15')]['message']);}})[_0x5e9a('0x16')](function(_0x3ece65){logger['error']('ChatApplication,\x20%s,\x20%s',_0x4134be,_0x3ece65);_0x5e63a6(_0x3ece65);});});}