Built motion from commit 1fa89557.|2.6.10
[motion2.git] / server / api / intDeskConfiguration / intDeskConfiguration.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 _0x6faf=['stringify','error','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6faf,0xf9));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xf6fa('0x0'));var moment=require(_0xf6fa('0x1'));var BPromise=require(_0xf6fa('0x2'));var rs=require(_0xf6fa('0x3'));var fs=require('fs');var Redis=require(_0xf6fa('0x4'));var db=require(_0xf6fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6fa('0x6'))('rpc');var config=require(_0xf6fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf6fa('0x8')][_0xf6fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f93f1,_0x1ac55e,_0x2de713){return new BPromise(function(_0x4e1b3c,_0x3f4d3f){return client[_0xf6fa('0xa')](_0x1f93f1,_0x2de713)[_0xf6fa('0xb')](function(_0x585633){logger['info'](_0xf6fa('0xc'),_0x1ac55e,'request\x20sent');logger[_0xf6fa('0xd')](_0xf6fa('0xe'),_0x1ac55e,'request\x20sent',JSON[_0xf6fa('0xf')](_0x585633));if(_0x585633['error']){if(_0x585633[_0xf6fa('0x10')]['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x1ac55e,_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);return _0x3f4d3f(_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);}logger[_0xf6fa('0x10')](_0xf6fa('0xc'),_0x1ac55e,_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);return _0x4e1b3c(_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);}else{logger[_0xf6fa('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x1ac55e,_0xf6fa('0x13'));_0x4e1b3c(_0x585633[_0xf6fa('0x14')]['message']);}})[_0xf6fa('0x15')](function(_0x476eeb){logger[_0xf6fa('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x1ac55e,_0x476eeb);_0x3f4d3f(_0x476eeb);});});}