17fc238d405711efa4bd693e0f628f3bfbc6321f
[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 _0xce08=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x6f3151,_0x406745){var _0x305fb8=function(_0x24e5a8){while(--_0x24e5a8){_0x6f3151['push'](_0x6f3151['shift']());}};_0x305fb8(++_0x406745);}(_0xce08,0xb4));var _0x8ce0=function(_0x1a10c0,_0xc8b33e){_0x1a10c0=_0x1a10c0-0x0;var _0x35af71=_0xce08[_0x1a10c0];return _0x35af71;};'use strict';var _=require(_0x8ce0('0x0'));var util=require(_0x8ce0('0x1'));var moment=require(_0x8ce0('0x2'));var BPromise=require(_0x8ce0('0x3'));var rs=require(_0x8ce0('0x4'));var fs=require('fs');var Redis=require(_0x8ce0('0x5'));var db=require(_0x8ce0('0x6'))['db'];var utils=require(_0x8ce0('0x7'));var logger=require('../../config/logger')(_0x8ce0('0x8'));var config=require('../../config/environment');var jayson=require(_0x8ce0('0x9'));var client=jayson[_0x8ce0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b2cf2,_0x1bbc5b,_0x66dc09){return new BPromise(function(_0x19c898,_0x1aa771){return client[_0x8ce0('0xb')](_0x5b2cf2,_0x66dc09)[_0x8ce0('0xc')](function(_0x2b5fa9){logger[_0x8ce0('0xd')](_0x8ce0('0xe'),_0x1bbc5b,_0x8ce0('0xf'));logger['debug'](_0x8ce0('0x10'),_0x1bbc5b,_0x8ce0('0xf'),JSON[_0x8ce0('0x11')](_0x2b5fa9));if(_0x2b5fa9[_0x8ce0('0x12')]){if(_0x2b5fa9[_0x8ce0('0x12')][_0x8ce0('0x13')]===0x1f4){logger['error'](_0x8ce0('0xe'),_0x1bbc5b,_0x2b5fa9[_0x8ce0('0x12')][_0x8ce0('0x14')]);return _0x1aa771(_0x2b5fa9['error'][_0x8ce0('0x14')]);}logger['error'](_0x8ce0('0xe'),_0x1bbc5b,_0x2b5fa9[_0x8ce0('0x12')]['message']);return _0x19c898(_0x2b5fa9[_0x8ce0('0x12')][_0x8ce0('0x14')]);}else{logger[_0x8ce0('0xd')](_0x8ce0('0xe'),_0x1bbc5b,_0x8ce0('0xf'));_0x19c898(_0x2b5fa9[_0x8ce0('0x15')]['message']);}})[_0x8ce0('0x16')](function(_0x125a4d){logger[_0x8ce0('0x12')](_0x8ce0('0xe'),_0x1bbc5b,_0x125a4d);_0x1aa771(_0x125a4d);});});}