c15c9dfad7c9d1aef8d54c1e1b19317b423bd782
[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 _0x0f69=['then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x20ac14,_0x26cdc9){var _0x1f9e71=function(_0x5f182f){while(--_0x5f182f){_0x20ac14['push'](_0x20ac14['shift']());}};_0x1f9e71(++_0x26cdc9);}(_0x0f69,0x173));var _0x90f6=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x0f69[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x90f6('0x0'));var BPromise=require('bluebird');var rs=require(_0x90f6('0x1'));var fs=require('fs');var Redis=require(_0x90f6('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x90f6('0x3'));var logger=require(_0x90f6('0x4'))('rpc');var config=require(_0x90f6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x90f6('0x6')][_0x90f6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45657d,_0x3b35a0,_0x3bc2eb){return new BPromise(function(_0x42044f,_0x488b53){return client[_0x90f6('0x8')](_0x45657d,_0x3bc2eb)[_0x90f6('0x9')](function(_0x3c8148){logger[_0x90f6('0xa')](_0x90f6('0xb'),_0x3b35a0,_0x90f6('0xc'));logger['debug'](_0x90f6('0xd'),_0x3b35a0,_0x90f6('0xc'),JSON['stringify'](_0x3c8148));if(_0x3c8148[_0x90f6('0xe')]){if(_0x3c8148['error'][_0x90f6('0xf')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x3b35a0,_0x3c8148[_0x90f6('0xe')]['message']);return _0x488b53(_0x3c8148[_0x90f6('0xe')][_0x90f6('0x10')]);}logger[_0x90f6('0xe')](_0x90f6('0xb'),_0x3b35a0,_0x3c8148['error'][_0x90f6('0x10')]);return _0x42044f(_0x3c8148['error']['message']);}else{logger[_0x90f6('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x3b35a0,_0x90f6('0xc'));_0x42044f(_0x3c8148[_0x90f6('0x11')][_0x90f6('0x10')]);}})[_0x90f6('0x12')](function(_0x3b4d5d){logger[_0x90f6('0xe')](_0x90f6('0xb'),_0x3b35a0,_0x3b4d5d);_0x488b53(_0x3b4d5d);});});}