Built motion from commit 3770a7bd.|2.6.29
[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 _0x0936=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x29a033,_0x3a9bf3){var _0x19226f=function(_0xfc40dc){while(--_0xfc40dc){_0x29a033['push'](_0x29a033['shift']());}};_0x19226f(++_0x3a9bf3);}(_0x0936,0xde));var _0x6093=function(_0x23052b,_0x4da2b5){_0x23052b=_0x23052b-0x0;var _0x517feb=_0x0936[_0x23052b];return _0x517feb;};'use strict';var _=require(_0x6093('0x0'));var util=require(_0x6093('0x1'));var moment=require(_0x6093('0x2'));var BPromise=require(_0x6093('0x3'));var rs=require(_0x6093('0x4'));var fs=require('fs');var Redis=require(_0x6093('0x5'));var db=require(_0x6093('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6093('0x7'));var config=require(_0x6093('0x8'));var jayson=require(_0x6093('0x9'));var client=jayson[_0x6093('0xa')][_0x6093('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7d812e,_0x478323,_0x54df66){return new BPromise(function(_0x5280b8,_0x219592){return client[_0x6093('0xc')](_0x7d812e,_0x54df66)[_0x6093('0xd')](function(_0x178aba){logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));logger[_0x6093('0x11')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x478323,'request\x20sent',JSON[_0x6093('0x12')](_0x178aba));if(_0x178aba[_0x6093('0x13')]){if(_0x178aba[_0x6093('0x13')][_0x6093('0x14')]===0x1f4){logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x219592(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x5280b8(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}else{logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));_0x5280b8(_0x178aba[_0x6093('0x16')][_0x6093('0x15')]);}})[_0x6093('0x17')](function(_0x5c8f2a){logger['error'](_0x6093('0xf'),_0x478323,_0x5c8f2a);_0x219592(_0x5c8f2a);});});}