579e7406420c6c2945e1b8981648c608efe3d10d
[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 _0xf7f7=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x235f97,_0x109c62){var _0x17e666=function(_0x50770f){while(--_0x50770f){_0x235f97['push'](_0x235f97['shift']());}};_0x17e666(++_0x109c62);}(_0xf7f7,0x192));var _0x7f7f=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xf7f7[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x7f7f('0x0'));var util=require(_0x7f7f('0x1'));var moment=require(_0x7f7f('0x2'));var BPromise=require(_0x7f7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f7f('0x4'))['db'];var utils=require(_0x7f7f('0x5'));var logger=require(_0x7f7f('0x6'))(_0x7f7f('0x7'));var config=require('../../config/environment');var jayson=require(_0x7f7f('0x8'));var client=jayson[_0x7f7f('0x9')][_0x7f7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ce9ad,_0x5c40ac,_0x2cb854){return new BPromise(function(_0x58ac2b,_0xebd8af){return client['request'](_0x2ce9ad,_0x2cb854)[_0x7f7f('0xb')](function(_0x4e5cc7){logger[_0x7f7f('0xc')](_0x7f7f('0xd'),_0x5c40ac,_0x7f7f('0xe'));logger['debug'](_0x7f7f('0xf'),_0x5c40ac,_0x7f7f('0xe'),JSON[_0x7f7f('0x10')](_0x4e5cc7));if(_0x4e5cc7['error']){if(_0x4e5cc7['error']['code']===0x1f4){logger[_0x7f7f('0x11')](_0x7f7f('0xd'),_0x5c40ac,_0x4e5cc7[_0x7f7f('0x11')][_0x7f7f('0x12')]);return _0xebd8af(_0x4e5cc7['error']['message']);}logger[_0x7f7f('0x11')](_0x7f7f('0xd'),_0x5c40ac,_0x4e5cc7[_0x7f7f('0x11')][_0x7f7f('0x12')]);return _0x58ac2b(_0x4e5cc7[_0x7f7f('0x11')][_0x7f7f('0x12')]);}else{logger[_0x7f7f('0xc')](_0x7f7f('0xd'),_0x5c40ac,_0x7f7f('0xe'));_0x58ac2b(_0x4e5cc7[_0x7f7f('0x13')][_0x7f7f('0x12')]);}})[_0x7f7f('0x14')](function(_0x175970){logger[_0x7f7f('0x11')](_0x7f7f('0xd'),_0x5c40ac,_0x175970);_0xebd8af(_0x175970);});});}