79c5fd52fcb569d7fdebdbd8aebeba2aee72a4bf
[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 _0x41f6=['error','message','DeskConfiguration,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xd54707,_0x10ebef){var _0x3fc12e=function(_0x12f7b9){while(--_0x12f7b9){_0xd54707['push'](_0xd54707['shift']());}};_0x3fc12e(++_0x10ebef);}(_0x41f6,0x8e));var _0x641f=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x41f6[_0x836465];return _0x2150ea;};'use strict';var _=require(_0x641f('0x0'));var util=require('util');var moment=require(_0x641f('0x1'));var BPromise=require(_0x641f('0x2'));var rs=require(_0x641f('0x3'));var fs=require('fs');var Redis=require(_0x641f('0x4'));var db=require(_0x641f('0x5'))['db'];var utils=require(_0x641f('0x6'));var logger=require(_0x641f('0x7'))(_0x641f('0x8'));var config=require(_0x641f('0x9'));var jayson=require(_0x641f('0xa'));var client=jayson[_0x641f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x118c00,_0x48c950,_0x5448f0){return new BPromise(function(_0x3425ca,_0x116a33){return client[_0x641f('0xc')](_0x118c00,_0x5448f0)[_0x641f('0xd')](function(_0x2ec42e){logger[_0x641f('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x48c950,_0x641f('0xf'));logger[_0x641f('0x10')](_0x641f('0x11'),_0x48c950,_0x641f('0xf'),JSON[_0x641f('0x12')](_0x2ec42e));if(_0x2ec42e[_0x641f('0x13')]){if(_0x2ec42e[_0x641f('0x13')]['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x48c950,_0x2ec42e[_0x641f('0x13')][_0x641f('0x14')]);return _0x116a33(_0x2ec42e['error'][_0x641f('0x14')]);}logger[_0x641f('0x13')](_0x641f('0x15'),_0x48c950,_0x2ec42e[_0x641f('0x13')][_0x641f('0x14')]);return _0x3425ca(_0x2ec42e[_0x641f('0x13')][_0x641f('0x14')]);}else{logger['info'](_0x641f('0x15'),_0x48c950,'request\x20sent');_0x3425ca(_0x2ec42e['result']['message']);}})[_0x641f('0x16')](function(_0x51ba91){logger[_0x641f('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x48c950,_0x51ba91);_0x116a33(_0x51ba91);});});}