Built motion from commit b5413ace.|2.6.9
[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 _0xd7c1=['request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s'];(function(_0x2cd3d8,_0x5ddfb0){var _0x1ee6e1=function(_0x39b230){while(--_0x39b230){_0x2cd3d8['push'](_0x2cd3d8['shift']());}};_0x1ee6e1(++_0x5ddfb0);}(_0xd7c1,0xa5));var _0x1d7c=function(_0x197e38,_0x1c37b9){_0x197e38=_0x197e38-0x0;var _0x129d53=_0xd7c1[_0x197e38];return _0x129d53;};'use strict';var _=require(_0x1d7c('0x0'));var util=require(_0x1d7c('0x1'));var moment=require(_0x1d7c('0x2'));var BPromise=require(_0x1d7c('0x3'));var rs=require(_0x1d7c('0x4'));var fs=require('fs');var Redis=require(_0x1d7c('0x5'));var db=require(_0x1d7c('0x6'))['db'];var utils=require(_0x1d7c('0x7'));var logger=require(_0x1d7c('0x8'))(_0x1d7c('0x9'));var config=require(_0x1d7c('0xa'));var jayson=require(_0x1d7c('0xb'));var client=jayson[_0x1d7c('0xc')][_0x1d7c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x13fc7a,_0x5d7e81,_0x42ff6c){return new BPromise(function(_0x568838,_0x44e7ca){return client[_0x1d7c('0xe')](_0x13fc7a,_0x42ff6c)[_0x1d7c('0xf')](function(_0x4a7eef){logger['info'](_0x1d7c('0x10'),_0x5d7e81,_0x1d7c('0x11'));logger[_0x1d7c('0x12')](_0x1d7c('0x13'),_0x5d7e81,'request\x20sent',JSON[_0x1d7c('0x14')](_0x4a7eef));if(_0x4a7eef[_0x1d7c('0x15')]){if(_0x4a7eef['error'][_0x1d7c('0x16')]===0x1f4){logger[_0x1d7c('0x15')](_0x1d7c('0x10'),_0x5d7e81,_0x4a7eef['error'][_0x1d7c('0x17')]);return _0x44e7ca(_0x4a7eef['error'][_0x1d7c('0x17')]);}logger[_0x1d7c('0x15')](_0x1d7c('0x10'),_0x5d7e81,_0x4a7eef[_0x1d7c('0x15')]['message']);return _0x568838(_0x4a7eef[_0x1d7c('0x15')]['message']);}else{logger[_0x1d7c('0x18')]('DeskConfiguration,\x20%s,\x20%s',_0x5d7e81,_0x1d7c('0x11'));_0x568838(_0x4a7eef['result'][_0x1d7c('0x17')]);}})[_0x1d7c('0x19')](function(_0xfafa7a){logger[_0x1d7c('0x15')](_0x1d7c('0x10'),_0x5d7e81,_0xfafa7a);_0x44e7ca(_0xfafa7a);});});}