d313699451d8ffeadd6d23b7f815eaae52ac9ce7
[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 _0x34e5=['jayson/promise','client','http','request','info','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4884a7,_0x18e38a){var _0x56b60e=function(_0x2ba8a3){while(--_0x2ba8a3){_0x4884a7['push'](_0x4884a7['shift']());}};_0x56b60e(++_0x18e38a);}(_0x34e5,0x172));var _0x534e=function(_0x53436a,_0x532489){_0x53436a=_0x53436a-0x0;var _0x532062=_0x34e5[_0x53436a];return _0x532062;};'use strict';var _=require('lodash');var util=require(_0x534e('0x0'));var moment=require('moment');var BPromise=require(_0x534e('0x1'));var rs=require(_0x534e('0x2'));var fs=require('fs');var Redis=require(_0x534e('0x3'));var db=require(_0x534e('0x4'))['db'];var utils=require(_0x534e('0x5'));var logger=require('../../config/logger')(_0x534e('0x6'));var config=require(_0x534e('0x7'));var jayson=require(_0x534e('0x8'));var client=jayson[_0x534e('0x9')][_0x534e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d0370,_0x2760e7,_0x5620d4){return new BPromise(function(_0x24d562,_0x929597){return client[_0x534e('0xb')](_0x2d0370,_0x5620d4)['then'](function(_0x59fcff){logger[_0x534e('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x2760e7,_0x534e('0xd'));logger['debug'](_0x534e('0xe'),_0x2760e7,_0x534e('0xd'),JSON[_0x534e('0xf')](_0x59fcff));if(_0x59fcff['error']){if(_0x59fcff[_0x534e('0x10')][_0x534e('0x11')]===0x1f4){logger[_0x534e('0x10')](_0x534e('0x12'),_0x2760e7,_0x59fcff[_0x534e('0x10')]['message']);return _0x929597(_0x59fcff[_0x534e('0x10')][_0x534e('0x13')]);}logger[_0x534e('0x10')](_0x534e('0x12'),_0x2760e7,_0x59fcff[_0x534e('0x10')][_0x534e('0x13')]);return _0x24d562(_0x59fcff[_0x534e('0x10')][_0x534e('0x13')]);}else{logger[_0x534e('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x2760e7,_0x534e('0xd'));_0x24d562(_0x59fcff[_0x534e('0x14')]['message']);}})['catch'](function(_0x2de9d0){logger[_0x534e('0x10')](_0x534e('0x12'),_0x2760e7,_0x2de9d0);_0x929597(_0x2de9d0);});});}