84e1a8ba0ff06fed9686079d4c722c7cb658aef4
[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 _0xfdf7=['info','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0xf65979,_0x202b31){var _0x35f5db=function(_0x2aa9ef){while(--_0x2aa9ef){_0xf65979['push'](_0xf65979['shift']());}};_0x35f5db(++_0x202b31);}(_0xfdf7,0xfa));var _0x7fdf=function(_0x206ca8,_0x34739a){_0x206ca8=_0x206ca8-0x0;var _0x508d10=_0xfdf7[_0x206ca8];return _0x508d10;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7fdf('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fdf('0x1'))['db'];var utils=require(_0x7fdf('0x2'));var logger=require(_0x7fdf('0x3'))(_0x7fdf('0x4'));var config=require('../../config/environment');var jayson=require(_0x7fdf('0x5'));var client=jayson[_0x7fdf('0x6')][_0x7fdf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x46d7fa,_0xe31014,_0x289a2c){return new BPromise(function(_0x4ef023,_0x50ffe2){return client[_0x7fdf('0x8')](_0x46d7fa,_0x289a2c)[_0x7fdf('0x9')](function(_0x4f69dd){logger[_0x7fdf('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0xe31014,_0x7fdf('0xb'));logger['debug'](_0x7fdf('0xc'),_0xe31014,_0x7fdf('0xb'),JSON[_0x7fdf('0xd')](_0x4f69dd));if(_0x4f69dd['error']){if(_0x4f69dd[_0x7fdf('0xe')][_0x7fdf('0xf')]===0x1f4){logger[_0x7fdf('0xe')](_0x7fdf('0x10'),_0xe31014,_0x4f69dd[_0x7fdf('0xe')]['message']);return _0x50ffe2(_0x4f69dd[_0x7fdf('0xe')]['message']);}logger[_0x7fdf('0xe')](_0x7fdf('0x10'),_0xe31014,_0x4f69dd[_0x7fdf('0xe')][_0x7fdf('0x11')]);return _0x4ef023(_0x4f69dd[_0x7fdf('0xe')][_0x7fdf('0x11')]);}else{logger[_0x7fdf('0xa')](_0x7fdf('0x10'),_0xe31014,_0x7fdf('0xb'));_0x4ef023(_0x4f69dd[_0x7fdf('0x12')][_0x7fdf('0x11')]);}})[_0x7fdf('0x13')](function(_0xcfa636){logger[_0x7fdf('0xe')](_0x7fdf('0x10'),_0xe31014,_0xcfa636);_0x50ffe2(_0xcfa636);});});}